RE: [PHP-DB] displaying a MySQL date in a different format

From: Date: Mon, 06 Jan 2003 13:35:08 +0000
Subject: RE: [PHP-DB] displaying a MySQL date in a different format
Groups: php.db 
Request: Send a blank email to php-db+get-24586@lists.php.net to get a copy of this message
I dont know if its the "best" solution, but I made a function that "cut" the date: function sqldate($fecha) { $dia=substr($fecha,0,2); $mes=substr($fecha,3,2); $anio=substr($fecha,6,4); $fechasql=$anio."/".$mes."/".$dia; return $fechasql; } You input 12/01/2002 and output 2002/01/12!!!! Fernando Bernain Senior A Business Process Outsourcing KPMG Argentina Tel: 54 11 4316 5754 Fax: 54 11 4316 5734 fbernain@kpmg.com.ar -----Original Message----- From: Ali McLeod [mailto:alimcleod@btinternet.com] Sent: Saturday, January 04, 2003 8:27 PM To: php-db@lists.php.net Subject: [PHP-DB] displaying a MySQL date in a different format Can anyone help me. I am trying to display a date in a different format from that stored in a MySQL database. MySQL forces you to store it as yyyy-mm-dd but I want to display it as dd-mm-yyyy, or dd-mmmm Any ideas? Many thanks in advance Ali McLeod alimcleod@btinternet.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Email Disclaimer The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter.

« previous php.db (#24586) next »