hi,
how to conver the date.
2007-10-15. i am getting the date from the database.i want convert this date to October 15, 2007.how can i convert. give some idea. please help to me.
thanks,
qumar.
how to conver the date
Moderator: General Moderators
- Josh1billion
- Forum Contributor
- Posts: 316
- Joined: Tue Sep 11, 2007 3:25 pm
Are you able to get a timestamp of the original date? If so, you can pass that timestamp as a second argument to date() and date() will format that timestamp into the specified format. If you don't have a timestamp, it may be possible to generate one based off of "2007-10-15", but I'm not sure if that might be more trouble than it's worth.
Code: Select all
Select date_format(my_date,'%M %d, %Y') from `tbl` limit 1;You can also do this with just php also..
Code: Select all
echo date('M d,Y',strtotime('2007-10-15'));- Josh1billion
- Forum Contributor
- Posts: 316
- Joined: Tue Sep 11, 2007 3:25 pm