change date format very easy in php

by admin on August 10th, 2010

If you have date in this 11-07-08 format, you can easily change the date according to you. like this:

formatted_date = date('Y-m-d',strtotime($date));

strtotime() returns the unix timestamp and you can use this timestamp in date() and get your date.

I hope its help you.

Thanks!
Enjoy Programming
🙂

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>