Jump to content

handling user time zones


jacko_162

Recommended Posts

As above,

 

im looking into how i can go about having each user select there prefered timezone upon registration, and perhaps storing it in a session.

 

then the time shown throughout my site shows there selected time zone and displays there own times.

 

how easy is it to impliment and what would be involved?

 

im assuming i have a "timezone" field in the members table and another table showing ID, timezone, and value

 

then when i call the timezone i can select the "value" from the session variable?

 

or am i over complicating things?

Link to comment
https://forums.phpfreaks.com/topic/195460-handling-user-time-zones/
Share on other sites

Timezones are actually a fairly difficult thing to handle...not overcomplicating it at all, and definitely not a bad question.

 

There are a few ways to do it, I'll get back with you on what I think would be the most elegant.  You could definitely store a property in the database (or session) and then use strtotime().

 

Take a peek at that, and I'll see what functions php has that natively take care of this.  Been a while since I've messed with this :)

 

Timezones are actually a fairly difficult thing to handle...not overcomplicating it at all, and definitely not a bad question.

 

There are a few ways to do it, I'll get back with you on what I think would be the most elegant.  You could definitely store a property in the database (or session) and then use strtotime().

 

Take a peek at that, and I'll see what functions php has that natively take care of this.  Been a while since I've messed with this :)

 

 

thank you for an informative reply. i will look into strtotime() a little more now.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.