RE: [PHP-DB] question regarding date format
| From: | John Holmes | Date: | Mon, 16 Sep 2002 19:14:22 +0000 |
| Subject: | RE: [PHP-DB] question regarding date format | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21790@lists.php.net to get a copy of this message | ||
Since this is in the DB mailing list, I assume you're getting that date
from a database? If it's MySQL, then you should use the DATE_FORMAT()
function to format the date column before you pull it out of the
database. Then there is no requirement for strtotime() or the date()
call for every row.
---John Holmes...
> -----Original Message-----
> From: Smita Manohar [mailto:smitamanohar@hotmail.com]
> Sent: Monday, September 16, 2002 1:11 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] question regarding date format
>
> hi all,
> a simple question regarding date, but i stuck with it .
>
> havin a variable containing date as,
> $date_test = "2002-08-02";
>
> now i want it should be printed like, August 02, 2002
> i am doing this with the funcion :
>
> echo date("F d, Y", $date_test);
>
> but getting a strange result as, January 01, 1970
>
> the same function working fine without second argument. ie, echo
date("F
> d,Y") is printing current date in the specified format.
>
> what wrong im doing using $date_test ??
>
> thanx and regards,
> smita.
>
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php