Re: Date Function

From: Date: Fri, 22 Feb 2008 19:52:57 +0000
Subject: Re: Date Function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-269895@lists.php.net to get a copy of this message
On Fri, Feb 22, 2008 at 2:48 PM, VamVan <vamseevan@gmail.com> wrote: > Hi All, > > Greetings!! > > A small PHP Script for help > > <?php > $date_format = '02/22/2008 14:00:00'; > > $start_date = date("Y-m-d h:i:s", strtotime($date_format)); > echo $start_date; > ?> > > output is 2008-02-22 02:00:00 > > but not 2008-02-22 14:00:00 > > How can i get my output as 2008-02-22 14:00:00. > > Thanks > V > http://us3.php.net/date Change the 'h' in your format to a capital H. Andrew

« previous php.general (#269895) next »