Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Time offset (auto detect)
« Reply #90, on April 26th, 2012, 04:51 PM »
Quote from Arantor on April 25th, 2012, 05:44 PM
If 'getting it approximately right' is acceptable, why bother with timezones anywhere and simply just use time offset?
Never said that... I'm saying getting it approx. right is good enough to provide a default selection in the select box if nothing is selected to begin with...
Quote
(I could just ignore the server time, force it set to UTC, not have a server time offset and just simply have everyone set their own time offset from that, but that would be unpleasant)
But that's how SMF does it, isn't it...?
Quote
Oh, I didn't look at the actual options in a phpBB website registration, but the presentation is still very much the same thing. (And DST is why time offset is fundamentally broken.)
Yeah... DST breaks a lot of things, not only in the computer world. Sigh.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #91, on April 26th, 2012, 07:35 PM »
Quote
But that's how SMF does it, isn't it...?
No, SMF takes server time from the server time's timezone, adds the 'server offset' then adds the 'user offset' and considers that good enough. Since the server timezone has to be set otherwise you get *flooded* with errors (think a warning with every time(), every date() call), you have to do something.

If the user timezone is set properly, you don't really have to have the server's time offset (though we *can* for the purposes of guest timezones, I guess), you just have to really worry about server + user timezone and everything else will pretty much just work.

Really what we're arguing about is how idiot proof we make it for the user, not the underlying code which is mostly working (it's ALL UI issues related to timezone, nothing else)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Time offset (auto detect)
« Reply #92, on April 27th, 2012, 04:58 PM »
Wouldn't it be simpler to just set the server/mysql time to UTC..?

One thing that bothers me -- I know it's not much but still: let's say you post at 7pm on a Saturday, after a Doctor Who episode. The next day, daylight savings come into play and suddenly if you read that post, it's marked as being sent at 6pm... Before the episode was shown!! What the hell?!
I'd like for timezones to be able to automatically apply the timezone's daylight savings to a unix timestamp immediately... Dunno if they do that, honestly :P

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #93, on April 27th, 2012, 05:03 PM »
Quote
Wouldn't it be simpler to just set the server/mysql time to UTC..?
No, because the system's clock will update with its local timezone rules, so you have to get that right, otherwise you'll get DST applying at times you have no knowledge of whatsoever.
Quote
I'd like for timezones to be able to automatically apply the timezone's daylight savings to a unix timestamp immediately... Dunno if they do that, honestly
They don't. You certainly could do it yourself, if you knew the timezone the post was written in, but that means storing it per post and doing extra calculations to do it. But for the extra hassle, it seems... overkill.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Time offset (auto detect)
« Reply #94, on April 27th, 2012, 05:26 PM »
Quote from Arantor on April 27th, 2012, 05:03 PM
No, because the system's clock will update with its local timezone rules, so you have to get that right, otherwise you'll get DST applying at times you have no knowledge of whatsoever.
But the server uses unix timestamps, doesn't it..? Isn't this a UTC timestamp?
Quote
They don't. You certainly could do it yourself, if you knew the timezone the post was written in, but that means storing it per post and doing extra calculations to do it. But for the extra hassle, it seems... overkill.
Yeah, I guess so... The Web is not ready yet for my overkill ;)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #95, on April 27th, 2012, 05:27 PM »
Quote
But the server uses unix timestamps, doesn't it..? Isn't this a UTC timestamp?
No, it's the server's timestamp. i.e. it's however many seconds since 1/1/1970 relative to the server's timezone. Super happy fun times.

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #97, on April 27th, 2012, 05:31 PM »
Only if the server is UTC. It just returns the system time, really.
Re: Time offset (auto detect)
« Reply #98, on April 27th, 2012, 10:14 PM »
OK, so I fixed the UI bug and added it to the registration page. It isn't pretty, but it's still better than what we have now.

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Time offset (auto detect)
« Reply #102, on July 24th, 2012, 06:43 PM »
Me neither...
Kinda went to other things because we couldn't agree on stuff here, IIRC... I've kept somewhere a copy of the timezones as shown by vBulletin and phpBB, both having their pros and cons. Still dunno what's best.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Time offset (auto detect)
« Reply #104, on July 24th, 2012, 08:30 PM »
Not entirely, but very close.

In vB:
- Caracaz is in its own (new?) timezone (-4.5)
- some cities are in the list that aren't in the other (and vice versa), overall the vB version is more targeted towards populated areas
- Indian cities use their 'modern' names (Mumbai instead of Bombay, Kolkata instead of Calcutta... Which sounds odd to me because in France we never 'cared' to follow the renaming)
- it supports Kathmandu (with its very amusing 5.75 offset)
- also adds a Yangon (Rangoon IIRC) timezone
- uses "Beijing" instead of "Taipei" in the 8.0 timezone (dunno about you, but it feels like they tried very hard to please the DRC government...)
- and adds some Russian places that aren't mentioned in phpBB such as Vladivostok and Kamchatka -- yeah, once again it looks like vB tried to please communist governments, eh eh.

Overall I'd say that the phpBB version is outdated since it's missing at least 3 timezones (-4.5, 5.75 and 6.5). It nearly looks like they took the phpBB version and simply updated it over time (maybe the phpBB version I found was from an old install, but it didn't seem like it, it had a modern skin).

Of course, it's not like they *can't* copy the phpBB version, after all we're all in the same world, using the same timezone system...