FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: Daniel on January 26, 2006, 04:22:24 PM

Title: mySQL/PHP Dates
Post by: Daniel on January 26, 2006, 04:22:24 PM
Hi guys.  For my site, I have a database that holds a date.  As anyone with mySQL knowledge knows, a date is stored in the database in a format like 1983-03-17.

How can I get these dates to be converted to a format like January 26, 2006 for when I display the data on my website?
Title: Re: mySQL/PHP Dates
Post by: webzone (archived) on January 26, 2006, 06:32:22 PM
Use strtotime() (http://php.net/strtotime) to convert the MySQL dates into UNIX timestamps.

Then, you can pass this timestamp as the second argument of the date() (http://php.net/date) function to get a date formatted exactly the way that you'll choose.
Title: Re: mySQL/PHP Dates
Post by: Daniel on January 29, 2006, 12:02:31 PM
Thanks for the timley support.