Forum Moderators: coopster

Message Too Old, No Replies

PHP Date Bug?

         

smagdy

5:00 pm on Jan 10, 2008 (gmt 0)

10+ Year Member



Hello!

How is that possible?

<? echo date('l','2008-01-04');?>

It displays: Thursday.

But on the Calendar its Friday..

Any thoughts?

Thanks in advance

PHP_Chimp

5:43 pm on Jan 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



string date ( string $format [, int $timestamp ] )

2008-01-04 is not a timestamp.
Try

date ('l', strtotime('2008-01-04'));

cameraman

5:43 pm on Jan 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The second parameter for date() [php.net] is a timestamp, so you would need to do something like this:
date('l',strtotime('2008-01-04'))

smagdy

6:12 pm on Jan 10, 2008 (gmt 0)

10+ Year Member



Thanks, worked :)