Having problems with displaying date

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi everyone,
I'm having problems displaying a date in the correct format and I was
wondering if anyone knew how to help.

I'm using pear to extract a date from our back end database (the date
is in DATE_FORMAT_ISO_EXTENDED), and I was to display the date in
"Wednesday, February 23rd 2005, 11:04" format.

I'm using something like:


$x = new Date();
$x->setDate( $DateTime_text); // $DateTime_text is from pear

$x->format( D ); // This doesn't work!

echo "$x<br>";


I've tried $x->format( %D ); but this gives a Parse error, saying that
it found "an unexpected '%', expecting ')'".

I've tried introducing quotation marks into the format function, even
escaping them, but nothing works. Can anyone help please?

Many thanks


Re: Having problems with displaying date

paul@paullee.com wrote:

Quoted text here. Click to load it

I haven't used PEAR before, but I'm guessing you should be supplying a
string to this function.

Try "$x->format( 'D' );" or "$x->format( '%D' );"

phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan /

Site Timeline