Re: Date formatting
| From: | Steve Cayford | Date: | Tue, 11 Dec 2001 21:23:57 +0000 |
| Subject: | Re: Date formatting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-77353@lists.php.net to get a copy of this message | ||
On Monday, December 10, 2001, at 09:35 PM, phantom wrote:
What would be an easy what to format a date value into month day year?? I want to specially display a date stored in mysql in date format YYYY-MM-DD The manual says: string date (string format, int [timestamp]) I tried $FormattedDate = date("F y, Y",${StoredDate})try $FormattedDate = date("F y, Y",strtotime($StoredDate)); strtotime will convert your YYYY-MM-DD string into a unix timestamp.
1999-04-15 spit out December 31, 1969 when I had hoped for April 15, 1999. Apparently YYYY-MM-DD is not a valid timestamp... i tried mysql formats of timestamp(8) and timestamp(14) and that didn't work either -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net