I have not counted the number of timezones in the dropdown but assuming 24 timezone offsets that comes out to 20 timezones per offset, which is about one page of a dropdown box (looking at the forum list on area51 right now in firefox 3). Assuming you know what your timezone offset is you would need to look through at most two such pages of timezones.
The code should be here: https://github.com/p/phpbb3/compare/dev ... z-handling
Edit: looks like the last commit broke migrations, which I forgot about. https://github.com/phpbb/phpbb3/pull/175 needs to be merged for me to work on fixing timezone branch.
Getting this error on login:
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4527: Undefined index: tz
Could be irrelevant.
You can see the timezone selector by pressing the agreement button on this page: http://108.35.7.206:8071/boards/tz1/ucp ... e=register
[RFC|Merged] Switch to PHP timezone handling
Re: [RFC|Accepted] Switch to PHP timezone handling
Last edited by Oleg on Thu May 05, 2011 5:07 am, edited 1 time in total.
Re: [RFC|Accepted] Switch to PHP timezone handling
That doesn't look too bad. Would be fine imo.
Re: [RFC|Accepted] Switch to PHP timezone handling
That's a huge list Looks impressive.nn- wrote:You can see the timezone selector by pressing the agreement button on this page: http://108.35.7.206:8071/boards/tz1/ucp ... e=register
But it does look nice.
I still wonder why germany is GMT+2 (o_O)
Re: [RFC|Accepted] Switch to PHP timezone handling
Are you referring to a political issue, is it incorrectly listed in the timezone selector or is your current GMT offset incorrectly determined by javascript?Sierron wrote: I still wonder why germany is GMT+2 (o_O)
Re: [RFC|Accepted] Switch to PHP timezone handling
Well the problem is that Germany is GMT+1 + DST. I actually searched upwards in GMT + 1 for it first. I think the GMT offsets should not include DST.
Anyway, I think this is going to work.
Anyway, I think this is going to work.
Re: [RFC|Accepted] Switch to PHP timezone handling
When the page loaded what timezone was selected for you? And what timezone would you have chosen were you actually registering?naderman wrote:Well the problem is that Germany is GMT+1 + DST. I actually searched upwards in GMT + 1 for it first. I think the GMT offsets should not include DST.
Re: [RFC|Accepted] Switch to PHP timezone handling
Yep. It defaulted to "Africa, GMT+2" here. I have an option "Zürich, GMT+2", but it should be "Zürich GMT+1". The DST offset should not be added.naderman wrote:Well the problem is that Germany is GMT+1 + DST. I actually searched upwards in GMT + 1 for it first. I think the GMT offsets should not include DST.
Re: [RFC|Accepted] Switch to PHP timezone handling
Same for me. I searched in the GMT+1 List and didn't saw it. Then I thought perhaps it's with DST and searched on the GMT+2 list.naderman wrote:Well the problem is that Germany is GMT+1 + DST. I actually searched upwards in GMT + 1 for it first. I think the GMT offsets should not include DST.
nn- wrote:When the page loaded what timezone was selected for you? And what timezone would you have chosen were you actually registering?
And my option is Berlin GMT+2igorw wrote: Yep. It defaulted to "Africa, GMT+2" here.
besides that: Why do you use GMT and not UTC?
Re: [RFC|Accepted] Switch to PHP timezone handling
Indeed, that's what we currently have.Sierron wrote:besides that: Why do you use GMT and not UTC?
- AmigoJack
- Registered User
- Posts: 110
- Joined: Wed May 04, 2011 7:47 pm
- Location: グリーン ヒル ゾーン
- Contact:
Re: [RFC|Accepted] Switch to PHP timezone handling
JS cannot tell you if DST is in effect. Your phpbb_preselect_tz_select() calls .getTimezoneOffset(), which gives me for GMT +0100 (DST) = CEST the value -120. So the JS function does what its name suggests: it gives you literally only the offset. Everybody can check it himself by entering this in the browser's address box:
You can only indirectly find out the two different UTC offsets of a user's browser: Right now I'm not sure if DST is always an increment (and never a decrement). But if that's the case you're also able to tell which one is the real timezone (the lower offset) and which one is the DST effect (the higher offset). So you can ultimately also detect that I'm now on summer time, not standard time. Which makes you select the right timezone with JS.
Code: Select all
javascript:alert( (new Date()).getTimezoneOffset() );