Page 1 of 1

greenwich meant time

Posted: Sun Oct 27, 2002 8:47 pm
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

Posted: Mon Oct 28, 2002 1:37 am
by Takuma
Try using setlocale() function...

Posted: Mon Oct 28, 2002 11:58 am
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