Re: date to string

From: Date: Fri, 02 Feb 2007 00:44:36 +0000
Subject: Re: date to string
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-248180@lists.php.net to get a copy of this message
John Taylor-Johnston wrote:
Chris wrote:
John Taylor-Johnston wrote:
How do I take "2007-02-01" and turn it into Thursday, February 1, 2006?
Use strtotime (http://php.net/strtotime) to turn it into a timestamp and then format it using date (http://php.net/date).
echo date("l, F j, Y", strtotime("2007-02-01")); That's it?
Seems to work ;) $ php -a <?php Interactive mode enabled echo date("l, F j, Y", strtotime("2007-02-01")); Thursday, February 1, 2007 Just noticed your original message said about turning 2007-02-01 into 2006 :P heh. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.general (#248180) next »