date problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

date problem.

Post 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?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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>';
;)
User avatar
Sevengraff
Forum Contributor
Posts: 232
Joined: Thu Apr 25, 2002 9:34 pm
Location: California USA
Contact:

Post by Sevengraff »

*sigh* figures.
thanks a bunch.
Post Reply