Hi,
I tested a modified version of your script with two additional lines that print the two unix timestamps using date:
The setting on the server is GMT+2
Result:
Friday 30th of July 2004 09:09:47 AM SERVER
Friday 30th of July 2004 07:09:47 AM GMT
1091214587 SERVER
1091221787 GMT
Friday 30th of July 2004 09:09:47 AM
Friday 30th of July 2004 11:09:47 AM gm
So I think the following happens if you use these functions without the optional timestamp argument (the current date/time).
- date just prints the string based on the current time on your server
- gmdate calculates the gmt time based on the local time and the server's timezone setting (mydatetime-2 in my case)
-mktime just calculates the unix timestamp based on the current date/time
-gmmktime takes the current date/time on the server, takes this as GMT date/time info and returns a time based on the timezone setting on the server (in this case mydatetime+2)
date: currentdate
gmdate: currentdate-2
mktime: currentdate
gmmktime: currentdate_used_as_GMT+2 to translate it to my current timezone setting GMT+2
Sound a little bit strange but seems to be the expected behaviour.
Thomas