Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #45, on March 30th, 2012, 12:46 PM »
I know exactly when it broke, I broke it when I changed over everything internally to use the proper PHP timezone functions.
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,079
Re: Time offset (auto detect)
« Reply #46, on March 30th, 2012, 12:46 PM »
Hmm... Meaning that their functions are broken? :P
Or just plain hard to use...! If someone like Arantor can't get them to work immediately!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #47, on March 30th, 2012, 12:55 PM »
Oh, the entire concept of date/time is complicated to get right, and I'd long wondered if I had or not.

That said, I never really wanted to keep the time offset anyway, and long ago started to make changes to move away from it to proper timezone support anyway. Internally it's even handled, too, I just didn't get as far as making a nice UI for it.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Time offset (auto detect)
« Reply #48, on March 30th, 2012, 01:05 PM »
Okay. :P

(Oh and tell me about complexity. I can barely even read time when giving by an analog clock...)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #49, on March 30th, 2012, 01:34 PM »
Well, it's going to end up being a dropdown to pick timezones rather than hour-offset. Which also means that India will be represented properly too.

Nao

  • Dadman with a boy
  • Posts: 16,079

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #51, on March 30th, 2012, 03:14 PM »
OK so I implemented the list of timezones. Unlike the admin one which is automatically populated, this one isn't because it does actually need to be shown to users and as such shouldn't have a bajillion entries that are mostly duplicated.

This is compiled off several different sources and should be accurate (and it should work, too) so when the site gets updated, give it a shot.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Time offset (auto detect)
« Reply #52, on March 30th, 2012, 03:15 PM »
Wouldn't it be easier to forget about timezones, then....? I don't know.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #53, on March 30th, 2012, 03:17 PM »
No, it really wouldn't.

The server absolutely *has* to have a timezone anyway, and PHP will vomit errors every call to time() and date() amongst other things if you try to call either without a timezone. So if you already have a timezone, you might as well do it properly and be done with it.

The plus side is that if you pick the right region, daylight savings should be handled automagically for you by way of the TZ database.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Time offset (auto detect)
« Reply #54, on March 30th, 2012, 03:23 PM »
'Kay then.

The code is really on the heavy side though... Here's hoping you won't have to update it!

Server updated to r1528. Including the French word, but I won't commit it for now. I'm OFF to Omega. See you later tonight!

spoogs

  • Posts: 417
Re: Time offset (auto detect)
« Reply #55, on March 30th, 2012, 03:29 PM »
I changed mine to Eastern US/Canada but it reverts to UTC-Dublin.......
Stick a fork in it SMF

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Time offset (auto detect)
« Reply #56, on March 30th, 2012, 03:40 PM »
Curious, that part worked for me as expected. Anyway, does it show the right times everywhere? (i.e. it's just a UI problem rather than anything else)
Posted: March 30th, 2012, 03:35 PM

OK, so I think this is a strange bug somewhere in the bowels of things. Timezone identifiers that have an _ in them appear to be broken, but any others work as expected (e.g. if you pick Central European, which is what I tested with, the internal identifier is Europe/Amsterdam, and it works as expected, but Eastern US/Canada is using America/New_York)

Hmm, I think this is a deeper problem with the profile code but I'll look into it.

spoogs

  • Posts: 417

Arantor

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

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: Time offset (auto detect)
« Reply #59, on March 30th, 2012, 05:34 PM »
Nice one :cool: If the server is in the US then there's a period between when the UK goes to savings time and when they do, and for that period the times are wrong. This fix will do away with this issue.

To let others know, in my profile it was listed UTC 0 (Dublin, etc) but I had to save my profile to get away from central European times.