MyBB Community Forums

Full Version: Detect time by country instead of timezone and daylight-saving time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If everybody would save his local country instead of the timezone and several daylight-saving time options, the timezone and the daylight-saving time could be detected automatically.

Now there are daylight-saving time options in ACP and in User-CP (yes/no & never/always/automatic) and it is not easy and self-evident to handle. (Plus: sometimes you have to try several combinations and back again to really get your current local time...)

If there were even an easier solution for detecting the (real!) current time of the user instead of saving the country, I would prefer the easier way of course.
HTML5 Geolocation + https://developers.google.com/maps/docum...n/timezone could work for this. We could cache the offset for a period of time to reduce queries.
We're using PHPs built-in timezones (eg Europe/London is saved and php determines which time that would mean). I'd guess that's pretty much what you suggested?

// The auto detection on registration/first visit hasn't been implemented yet but I hope that we'll do that.
Sounds terrific. Great. Smile
(2015-10-26, 07:57 PM)Amaryllion Wrote: [ -> ]If everybody would save his local country instead of the timezone and several daylight-saving time options, the timezone and the daylight-saving time could be detected automatically.

Now there are daylight-saving time options in ACP and in User-CP (yes/no & never/always/automatic) and it is not easy and self-evident to handle. (Plus: sometimes you have to try several combinations and back again to really get your current local time...)

If there were even an easier solution for detecting the (real!) current time of the user instead of saving the country, I would prefer the easier way of course.

Country is not enough to determine time zone and rules for daylight savings time. The zoneinfo database has defined time zones based on area (generally name of the continent or ocean) and location (often a city). A sample zone is America/New_York. Once a zone is entered, the user doesn't have to fuddle with DST.
Well, glad that we sorted that out, laie_techie. I will finally find a little sleep this night.
FWIW, the builtin time zones mentioned by Jones are based on zoneinfo.