[thelist] Re: [PHP] convert date format

Dan Romanchik dan at danromanchik.com
Thu Mar 24 09:15:14 CST 2005


If you're pulling the date out of a database, you can also do it within the
query itself using the DATE_FORMAT function. Here's a QUERY I use for a real
estate site I just did some programming for:

SELECT PropertyID,Title, DATE_FORMAT(LastUpdate, '%M-%d-%Y, %r') AS
LastUpdate FROM Properties

Regards,

Dan
--------------------------------------------------------------------
Dan Romanchik - Web Developer
dan at danromanchik.com, 734-930-6564


----- Original Message -----
From: <john at johnallsopp.co.uk>
To: <thelist at lists.evolt.org>
Sent: Thursday, March 24, 2005 6:24 AM
Subject: [thelist] Re: [PHP] convert date format


> > I need to convert a date from this format: 2005-03-25 to 25 mar 2005.
>
> echo (date("j M Y", strtotime('2005-02-24')));





More information about the thelist mailing list