Re: Format Date

From: Date: Thu, 07 Dec 2000 19:12:55 +0000
Subject: Re: Format Date
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-4363@lists.php.net to get a copy of this message
On Thu, 7 Dec 2000 10:28:22 -0200, you wrote: >Hi There, > >I'm new tin PHP, and I need to format a date (dd/mm/yyyy) retrieved from >MySQL , how to do that??? > >Thank's a lot It depends of the mysql data type you use to handle dates. Here it is what I've used for a "timestamp" mysql type: list($ano, $mes, $dia, $hh, $mm, $ss) = sscanf($timestamp_string, "%04d%02d%02d%02d%02d%02d"); printf("%02d/%02d/%04d - %02d:%02d:%02d", $dia, $mes, $ano, $hh, $mm, $ss); Regards. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ** RoMaN SoFt / LLFB ** roman@madrid.com http://pagina.de/romansoft ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

« previous php.windows (#4363) next »