User-defined timezone effecting all times recorded

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

User-defined timezone effecting all times recorded

Post by phice »

Please read http://devnetwork2.net/viewtopic.php?t=112 and answer the last post, in this thread, if at all possible.

I need to know how I should store times, if I should change the time to server time when the user puts in a timezone-specific time. Any other help would be great.
Image Image
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I think a server should always run in gmtime and all dates should be stored in gmtime too.

Depending on the users locale (or by asking him) you can lookup the offset and calculate the gmtime.
I've experienced that it can easily become a mess if store usertimes if those users are in different timezones.
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

I think a server should always run in gmtime and all dates should be stored in gmtime too.
I agree.

I use a seperate wrapper function for time() to fix those servers that are running slow or fast or not on GMT.
Post Reply