Page 1 of 1

Server time

Posted: Wed Dec 15, 2004 3:19 am
by irealms
I'm using the time() function to create the time a message is entered but it's coming out 1 hour ahead, i'm on GMT time so not sure why it's doing this any ideas?

Posted: Wed Dec 15, 2004 3:32 am
by kettle_drum
time() gives you the time that the server has set. Either change the server time, or accept that time() will give you gmt+1 and work to this value or remove 3600 from the result it gives you.

Posted: Wed Dec 15, 2004 5:42 pm
by Simon
Hmmm.... I pretty certain that time() produces the GMT timestamp. Most of the other date functions do actually return the server's date/time by correcting the timezone (unless you use gmdate() etc.), I've been confused by this in the past. Either you're using date() or another date function to actually display the timestamp readibly and it's converting it for you, or your server timezone is set incorrectly. Perhaps daylight-savings could somehow be affecting it too.

See: http://www.php.net/time

< Simon >