Welcome visitor
* Login
* Register
It is currently May 21st, 2019, 12:36 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Server Side » PHP



Post new topic Reply to topic  [ 4 posts ] 
Author Message
  date format
PostPosted: February 17th, 2009, 3:37 am 

Posts: 46
Hi,
i have this form that gets a date by the user, but it does it in 3 different variables, so how can i put them all together like a date format var?
Thanks for the help.


Top
 Profile  
 
  Re: date format
PostPosted: February 17th, 2009, 3:48 am 
User avatar

Posts: 86
It seems like something implode() can handle very easily. If you have the year on the 'yyyy' format, the month is 'mm' and the day is 'dd' you only need to do something like this:
$array = array('year', 'month', 'day');

$dateTogether= implode("-", $array);

echo $dateTogether; //just a test

And if you dont have your days, months and/or years in that format you will need to fix it before creating the array.


Top
 Profile  
 
  Re: date format
PostPosted: February 17th, 2009, 3:57 am 

Posts: 46
And what if the month is the complete name? any suggestions on how to change it?
Thanks so much.


Top
 Profile  
 
  Re: date format
PostPosted: February 17th, 2009, 4:03 am 
User avatar

Posts: 86
Well it depends on the way you have your form. If I be you, I would use a dropdown menu, being the value of each month its number, like this:
<option value=01>January</option>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

FORUMS » Server Side » PHP


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron