Re: Date format

From: Date: Mon, 17 Jul 2000 15:02:03 +0000
Subject: Re: Date format
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-1190@lists.php.net to get a copy of this message
Hi, this works fine, but everytime when $datum is empty it show me "30-11-1999". Why? See litle bit altered code of your function: function format($iso-date) { list($year,$month,$day,$hour,$minute,$second) = split('[- :]', $iso_date); $date_temp = mktime($hour,$minute,$second,$month,$day,$year); $pretty_date = date($d-m-Y,$date_temp); echo $pretty_date; } ----- Original Message ----- From: Ed Finkler <coj@goldendome.com> To: <php-db@lists.php.net> Sent: Monday, July 17, 2000 4:29 PM Subject: Re: [PHP-DB] Date format > If it's an ISO-formatted date (which it looks to be), this code we use > should work: > > function pretty_date($date_format,$iso_date) > { > list($year,$month,$day,$hour,$minute,$second) = split('[- :]', $iso_date); > $date_temp = mktime($hour,$minute,$second,$month,$day,$year); > $pretty_date = date($date_format,$date_temp); > return $pretty_date; > } > > the $date_format should be a standard formatting string as used by the > date() function. > > Hope this helps, > > Ed Finkler > Supervisor of Web Development > Golden Dome Media > http://www.goldendome.com > coj@goldendome.com > voice: 219.631.1107 > cell: 219.532.3170 > fax: 219.631.1101 > > > ----- Original Message ----- > > I am using ODBC to get a dates from my MS Access database, > > but problem comes when I need change format of dates I get.. > > What I get is: "2000-04-12 14:06:09" > > what I need is only: "12-04-2000" > > > > Do someone know how should I make it? > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.db (#1190) next »