changing date format
Moderator: General Moderators
-
Anglophobe
- Forum Newbie
- Posts: 11
- Joined: Tue May 09, 2006 11:50 am
changing date format
I'm looking to take a date input format such as 05-15-06, store it in MySQL (I think the only way is 2006-05-15), and then output it back again as 05-15-06. It would be really easy if MySQL stored dates the way I want, but I don't think it does, and I need it to be able to sort by date. Thanks
On my opinion it better to use unix timestamp: time(); ().
It simple digital value and u can easy get date in different formats using date() function:
It simple digital value and u can easy get date in different formats using date() function:
Code: Select all
echo time(); // 1147715737
echo date('m-d-y',1147715737); // 05-15-06