how to reformat date info retrieved from mysql in php

From: Date: Fri, 07 Jul 2000 08:50:11 +0000
Subject: how to reformat date info retrieved from mysql in php
Groups: php.general 
Request: Send a blank email to php-general+get-5342@lists.php.net to get a copy of this message
Hi, I want to give a date which I retrieve from a mysql database a readable format in my webpage. In mysql the field is defined as date and has the the format yyyymmdd. In my webpage I want to show it as dd-mm-yyyy. When I use the date('%d-%m-%Y', $datefield) function I always get a date sometime in 1970 or so. BTW for several reasons I do not want to use the format_date() function of mysql in my query, which of course could do the job (e.g. I need the raw date format for other purposes as well). Thanks Mike ---- Disclaimer --- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

« previous php.general (#5342) next »