By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,640 Members | 2,597 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,640 IT Pros & Developers. It's quick & easy.

help with dates

P: 67
I have a MySQL table with a date column (YYYY-MM-DD)
I am selecting this and outputting it through PHP.
Is there anyway to output it as MM-DD-YYYY ?
Also can i out put the MM as Jan Feb Mar... etc.
Feb 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: 25
I have a MySQL table with a date column (YYYY-MM-DD)
I am selecting this and outputting it through PHP.
Is there anyway to output it as MM-DD-YYYY ?
Also can i out put the MM as Jan Feb Mar... etc.
[PHP]
$new_timestamp = strtotime($row['date']);
$r_date = date ("m-d-Y", $new_timestamp);
echo $r_date;
[/PHP]
Feb 2 '07 #2

P: 25
[
][PHP]
$new_timestamp = strtotime($row['date']);
$r_date = date ("M-d-Y", $new_timestamp);
echo $r_date;
[/PHP]
This is for MM= Jan,Feb etc.
Feb 2 '07 #3

P: 67
awsome exactly what i needed,
thanks
Feb 2 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.