Re: Formatting a date column retrieve from a table

From: Date: Tue, 10 Oct 2000 15:31:51 +0000
Subject: Re: Formatting a date column retrieve from a table
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-19365@lists.php.net to get a copy of this message
I have tried using the following lines of code. I have not found any other way to acomplish this task: $fecha = odbc_result($cur,4); $fecha = date("d/m/y", mktime(0,0,0,substr($fecha,6,2),substr($fecha,9,2),substr($fecha,0,4))); Any suggestion would be appreciated; "Daniel Convissor" <danielc@analysisandsolutions.com> escribió en el mensaje news:39E327FC.11D90524@analysisandsolutions.com... > Hi Jon: > > > I am beginnig with php and I am trying to format, with local settings, a > > date column. Following php manual I would like to use DATE function, anyway > > I do not know the way to convert the retrieved date to a timestamp that is > > one of the requiered arguments of this function. > > Which database engine are you using? Anyway, their date is probably stored > as 2000-10-10, or some similar format. As you said, you need a Unix > timestamp to do anything. One option is to use the databases functions to > generate the timestamp. For example, MySQL has a UNIX_TIMESTAMP() function. > The other option is to use PHP's mktime() function. > > Enjoy, > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > More than just answers. Solutions. (SM) > http://www.analysisandsolutions.com/ > 4015 7 Av #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#19365) next »