greenwich meant time

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
rory
Forum Newbie
Posts: 2
Joined: Sun Oct 27, 2002 8:47 pm

greenwich meant time

Post by rory »

I just ran this little php script

echo gmdate ("Y-m-d-h:i:s"). "<br>"
. date ("Y-m-d-h:i:s",gmmktime());
echo "<br>local<br>";
echo date ("Y-m-d-h:i:s"). "<br>"
. date ("Y-m-d-h:i:s",mktime());


and it gave me the following output

2002-10-28-02:34:25
2002-10-27-10:34:25
local
2002-10-27-06:34:25
2002-10-27-06:34:25

Surely if date of local time equals date of mktime then date of gmt should equal gmmktime?

I'm lost, can anyone help?

many thanks
Rory
PS you'll find it at http://ownworld.com/test.php
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Try using setlocale() function...
rory
Forum Newbie
Posts: 2
Joined: Sun Oct 27, 2002 8:47 pm

Post by rory »

that is the workaround I have used - it works. Still interested to know why the other doesn't. Any ideas?

thanks for your response
rory
Post Reply