Re: Date format

From: Date: Mon, 17 Jul 2000 14:29:47 +0000
Subject: Re: Date format
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-1184@lists.php.net to get a copy of this message
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?

« previous php.db (#1184) next »