Page 1 of 1

date problem.

Posted: Tue May 13, 2003 5:55 pm
by Sevengraff
Here is my code...

Code: Select all

<?PHP
echo time() . '<br>';
echo mktime() . '<br>';
echo date('F nS, Y') . '<br>';
echo gmdate('F nS, Y') . '<br>';
echo gmdate('F nS, Y', time()) . '<br>';
echo date('F nS, Y', '1234567890');
?>
and output of above code...

Code: Select all

1052866374
1052866374
May 5th, 2003
May 5th, 2003
May 5th, 2003
February 2th, 2009
The problem is that my computer's clock is set to May 13, todays date! Im running PHP 4.2.3 with Apache on a regular Windows 2000 desktop. I was trying to learn what I could do with a UNIX time stamp, and don't undersand why this is showing the wrong date.

Any ideas?

Posted: Tue May 13, 2003 6:20 pm
by volka
http://www.php.net/manual/en/function.date.php
d Day of the month, 2 digits with leading zeros 01 to 31
...
n Numeric representation of a month, without leading zeros 1 through 12

Code: Select all

echo date('F dS, Y') . '<br>';
;)

Posted: Tue May 13, 2003 7:05 pm
by Sevengraff
*sigh* figures.
thanks a bunch.