I've got a date stored in a MySQL database in a DATE field, so it is
stored as 2001-05-21. How do I convert that into a more friendly date like
21 May 2001 or even 21st May 2001 for display on a web page?
I've tried
print date(jS F Y, $dbtable[date]);
but I always get 1st January 1970 because
Mathew,
Great that they're backwards from one another, isn't it?
The regular expression wizards probably have some marvellous trick up their
sleeve, and Manuel Lemos probably has a class that will do this. You can do
it yourself by using substring functions to extract the parts of the date,
Matthew Ralston wrote:
I've got a date stored in a MySQL database in a DATE field, so it is
stored as 2001-05-21. How do I convert that into a more friendly date like
21 May 2001 or even 21st May 2001 for display on a web page?
I've tried
print date(jS F Y, $dbtable[date]);
but I
Thanks Papi,
That works fine.
Matt
[EMAIL PROTECTED]
www.mralston.co.uk /
Pavel Jartsev [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Matthew Ralston wrote:
I've got a date stored in a MySQL database in a DATE field, so it is
stored as 2001-05-21. How
]
To: Matthew Ralston [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, May 23, 2001 6:21 AM
Subject: Re: [PHP] Converting MySQL Date (2001-05-21) to Friendly Date (21
May 2001)
Matthew Ralston wrote:
I've got a date stored in a MySQL database in a DATE field, so it is
stored as 2001-05-21
5 matches
Mail list logo