RE: [PHP] How to convert '2001032018' -> '2001 03 20 18' ? (Fomat ing Date)

From: Date: Tue, 20 Mar 2001 19:04:26 +0000
Subject: RE: [PHP] How to convert '2001032018' -> '2001 03 20 18' ? (Fomat ing Date)
Groups: php.general 
Request: Send a blank email to php-general+get-44800@lists.php.net to get a copy of this message
function sql_to_unix_time($timeString) { return mktime(substr($timeString, 8,2), substr($timeString, 10,2), substr($timeString, 12,2), substr($timeString, 4,2), substr($timeString, 6,2), substr($timeString, 0,4)); } you can use the above function to convert your mysql time stamp to a unix timestamp (how long ago was the epoch? ) and use php time related functions (such as time() )to manipulate it however you want. PS: The function is not mine. -----Original Message----- From: SED [mailto:sed@sed.is] Sent: Tuesday, March 20, 2001 1:59 PM To: php-general@lists.php.net Subject: [PHP] How to convert '2001032018' -> '2001 03 20 18' ? (Fomating Date) Hi, I'm trying to convert the timestamp '2001032018' into '2001 03 20 18' or an Array which I can easily format. Do you remember any date or string function I can use? Regards, Sumarlidi Einar Dadason SED - Graphic Design ------------------------------------------ Phone: (+354) 4615501 Mobile: (+354) 8960376 Fax: (+354) 4615503 E-mail: sed@sed.is Homepage: www.sed.is <- New Homepage! ------------------------------------------ -- 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 (#44800) next »