Re: date

From: Date: Wed, 20 Nov 2002 09:41:13 +0000
Subject: Re: date
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125203@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 2 fonction for that ;) written specially for the same pb as you ;) // transformation de la date jj/mm/aaaa -> aaaa-mm-jj function modate ( $date ) { $inter= split("/",$date) ; $date=$inter[2]."-".$inter[1]."-".$inter[0] ; return $date ; } // transformation de la date aaaa-mm-jj -> jj/mm/aaaa function revmodate( $date ) { $inter= split("-",$date) ; $date=$inter[2]."/".$inter[1]."/".$inter[0] ; return $date ; } Le Mardi 19 Novembre 2002 15:10, Edward Peloke a écrit : > I am pulling from a datetime field in mysql. The actual data looks like > this: 2002-11-30 00:00:00 When I output the data to the page, I want it to > appear as 11/30/2002. I want to use a php date format. I do not want it > formatted as it comes out of the db. But date("m/d/y", $myrow[departdate]) > returns 12/31/69. How can I do this? > > THanks, > Eddie - -- __________ / Matthieu Le Corre | Service Informatique | ____________________ | Inspection Academique de la Sarthe | 72000 LE MANS | ____________________________ | Tel : 02 43 61 58 91 | Mail : Matthieu.lecorre@ac-nantes.fr \____________________________________ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE921i5iQG6YxCcev4RAu1jAJ0UFm1XAp7C8zKeOPc/CEA32jZpdgCfReBY 3uhaeYd614pugiecRDDCYOM= =7f9l -----END PGP SIGNATURE-----

« previous php.general (#125203) next »