HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


v7 Missing time zones

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#69403 (In Topic #14698)
Avatar

Community saint

The time zone I'm interested in, (GMT+10:00) Canberra, Melbourne, Sydney, is missing. I can't use any of the other +10:00 time zones due to daylight savings differences.

Having a casual look at the different time zones in ocPortal vs those in Windows 7, I can see many differences ranging from missing zone, like that listed above, different offsets "(GMT+01:00) Windhoek" in ocPortal vs "(GMT+02:00) Windhoek" in Windows 7, and different groupings "(GMT-04:00) La Paz" in ocPortal vs "(GMT-04:00) Georgetown, La Paz, San Juan" in Windows 7.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#69407
Avatar

The code was integrated from a combination of tzphp (which I think is fine here) and a conversion list we found, possibly this one:
php - Changing the timezone on the fly - Stack Overflow
Some changes were made to make them match up right. I looked around just now and Melbourne is not represented in most of the similar mappers I found.

I did find it here though:
Working With Time Zones in PHP | UltraMega Blog

Patches welcome :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69408
Avatar

Just to be clear, the get_timezone_list() function is at fault here. It returns a widely used mapping to convert the nasty unix-style names to nicer names, but it's cut down (which is again for usability).
It's important of course that the unix-style names match up with the big list defined at the top of the file.

I don't want to get too stuck maintaining the list because I'm not really sure what all the timezones actually are. But it should be relatively easy for people to send in altered versions of the file that make it correct for areas they know (or they've looked at the Windows list and given it some thought and carefully checked they have matched everything up right) and then I can merge the changes in.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69411
Avatar

Community saint

And what about daylight savings info? If time zones need to be added, how is the daylight savings info (where required) managed/reconciled?

(You'd thing that there would be easily locatable definitive list of these kinds of things out there. When I tried to find a complete list of countries a few weeks ago I ran into similar problems.)


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#69412
Avatar

I forgot to mention the file, sources/temporal.php. The unix timezone database replicated at the top of the file has it all, it is the mappings at the bottom at issue - Melbourne actually has an entry at the top, just not at the bottom. So a line needs adding.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69623
Avatar

Community saint

Chris, here is my updated version of the timezone list. Its a complete re-write so that the list reconciles 100% with the timezone data.

The old list covered 133 locations (Not including duplicates for Kamchatka & La Paz) over 88 rows.

The new list covers 378 locations over 127 rows, with a maximum of 6 locations per row.

As I have not corrected any of the timezone data, the new entry for Caracas is now GMT-04:00, which is incorrect and should be GMT-04:30.

I have also dropped any locations that are not listed in timezone data, such as Nuku Alofa, which was listed against Pacific/Tongatapu.

I have not added any new timezones either, which was hard to resist given that it meant that Canberra, the capital city of my own country, would have to be ignored.

The only issue I see with using this new list is that, due to the many changes, the time zones set in many users profiles will no longer match (when I first checked in in my profile, the '(GMT+10:00) Hobart' I had previously was not recognised and it dropped back to the first item in the dropdown list) . It won't affect my users as I have yet to launch my site, but it will affect other, especially those that have locations not that are no longer in the list. How (what structure) is the timezone info saved in a users profile?

I think that there may be an underlying issue with how timezones are stored in a user profile (if my experience is not some anomaly) that makes updates to the timezone list troublesome. For example, Caracas is now listed as:

Code

'America/Caracas'=>'(GMT-04:00) Caracas, Curacao, Dominica, Grenada, Guadeloupe, Guyana'
And a 'quick fix' to the timezone list might be to split is as follows:

Code

'America/Curacao'=>'(GMT-04:00) Curacao, Dominica, Grenada, Guadeloupe, Guyana'
'America/Caracas'=>'(GMT-04:30) Caracas'
That's fine, except that I suspect that anyone that had selected "(GMT-04:00) Caracas, Curacao, Dominica, Grenada, Guadeloupe, Guyana" would now be timezone orphans.

I was initially going to reconcile the tomezone list with that in Windows 7, but the above issue has put me off pursuing that at the moment.

Expand: Updated timezone list Updated timezone list


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#69675
Avatar

Hi,

That's fantastic. I see the Caracas issue. I've now fixed that, no idea how that would have got in. I'm a bit surprised you found it though, did you actually manually test them all, or was it by chance?

Your problem with Hobart is that by removing a list entry corresponding to 'Australia/Hobart' (which is what it would be saved as) it had nothing to select.
I'm curious why you removed it actually. What was the basis for deciding what should go, and what should come in?


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69682
Avatar

Community saint

I reworked everything in excel and had "sanity check' formulas to make sure I didn't introduce any new errors and so that I could account for everything. Caracas was picked up by one of the sanity checkers and I verified it online.

Hobart wasn't removed, it was just rezoned "(GMT+10:00) Currie, Hobart" by my grouping (i.e. row consolidation) formula.

And herein lays the problem of what was stored in the profile. Instead of storing "(GMT+10:00) Hobart", its probably a lot better to store "Australia/Hobart". At least that way if "Australia/Hobart" no longer exists as a key in the timezone list, a new key could be found by interrogating the timezone data table. i.e. self healing code.

As for what was removed, it was any location that did not also appear in the timezone data. Those location were piggybacking off others and were therefore potentially unreliable for daylight saving assignments. I did not follow up as to why those discrepancies were there, but looking at it now, some of those appear as discretionary name changes.

For example, "Nuku Alofa" is the capitol of Tonga and is located on the island of Tongatapu (I learn something new every day!), so "Pacific/Tongatapu" would have been a valid entry. Yet Suva is the capitol of Fiji, and is not listed against Pacific/Fiji.

There are inconsistencies at every level which get compounded when multiple location appear per row, but at least my list gets things back to a known state. With the "Nuku Alofa" example above, as there was no information to explain that discrepancy, I felt it was best to be safe.

New entries could be managed by adding _ocp suffixes to new timezone data entries, for example "Australia/Canberra_ocp" to signify non-standard entries, so that there is full 1-1 correlation between the timezone data and timezone lists.

I actually think that the timezone list should be dropped and dynamically generated from the timezone data (with appropriate caching of course if you think its needed, but I don't think caching is necessarily needed as a timezone drop-down isn't going to be used very often in the grand scheme of things).

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#69684
Avatar

I think we're getting into the kind of tricky details now I wanted to avoid. Really the advantage to using a pre-established list is whatever technical and political differences involved would have been at least partly worked out before, even if there were errors.
Take this line from what was there before:
"Chennai, Kolkata, Mumbai, New Delhi"
The technical name is 'Asia/Calcutta', but I think it has to have 'New Delhi' in because that's the capital. As I understand, India is quite fragmented, so people look for their states capital sometimes, rather than just New Delhi. So I am very wary to mess around too much with the naming. There's also the issue of consistency with what they select in other software.
Another example is Islands. Maybe one island is chosen to be the center of a timezone, but people on other islands wouldn't know that necessarily. So it could get very complex very fast.

I think a better approach is letting people correct serious mistakes or omissions in what is already there, and not relying too much on the technical names.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69708
Avatar

Community saint

I don't have an issue with the use of non-technical (friendly) names, its just that in the current structure there is no facility for 1-to-1 mapping of friendly names back to technical names (b.t.w., I don't mind doing that mapping as I can isolate those easy enough, just needs a little leg-work to validate them).

When a location has a change to its daylight savings details, the timezone data might get updated, but what are the chances that the multi-local timezone list also gets verified to see if it needs to split a row?

The Windows timezone data I have indicates that there are at least 28 locations that have had daylight savings adjustments since 2004. If that was the ocPortal list, then that would have resulted/required a minimum of 88 (because some locations have DST changes almost every year) split investigations.

If the timezone data contained a friendly name field, and the timezone list was automatically rebuilt, then that would eliminate the need for any future split investigations as they would split automatically.

This would simplify future maintenance, support politically correct names, and provide a 'safe' mechanism to be able to add new locations which are not defined in the php set.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#69718
Avatar

It's the unix-style names that are saved though, so I don't think there's a problem. E.g. I just selected '(GMT-01:00) Azores' to confirm this and 'Atlantic/Azores' was saved.
The only issues I see are:
  • if no corresponding line for 'Atlantic/Azores' existed anymore, it would reset to the first selection when editing. However I don't see that happening (it happened with your changes, I think you consolidated some, but if it happens once it's a one off - future consolidation seems unlikely). I just don't see it as a problem in practice, and I'd rather avoid adding extra code to try and find closest-matches because we're always fighting low PHP memory limits and extra code weight is counted to that.
  • If we do have to split out a line that uses a unix-name relating to placeA but is consolidated to include placeA and placeB, because they no longer agree on DST switch-times (for example), then people from placeB will be set to placeA until they change it. But again, I think it's a very small problem.

So really, to me I don't want to automate anything because political/technical differences that the current mapping incorporates will be erased, and I can just see a torrent of complaints further down the line.
And, I don't want to incorporate a manually done change done to a similar algorithm.

I'd rather have an overly-verbose set of cities against a minimised list of distinct timezones, ideally consistent with what Microsoft have done as they will have tried to accomodate all the politics etc before.
Yes, this requires tolerating some maintenance issues, but I think they're quite minor and compared to the potential political ones, or the usability (and memory usage) ones caused by having an exhaustive list.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69725
Avatar

Community saint

Its good that the unix-style names are stored.

Memory considerations are certainly valid.

With the automation, I wasn't implying that the automation occur with just the technical names and dropping the political names (or additional cities for that matter). Sorry if I was not clear enough on that point. In any case, with your memory concerns its a moot point now anyway.

As a compromise then, I could do a once-off manual consolidation based on the 378 locations I posted + the 63 political differences (which includes additional locations like Chennai that are not explicitly covered by the timezone data) that are in the current ocPortal timezone list.

I may also correct for some of the 55 political names/additional locations that are in my windows list if I can do so easily/safely (the way the daylight saving data is encoded does not make for easy reconciliation with ocPortal).

Net result:
- much larger list of locations that currently exist

- all existing ocPortal political name changes / additions maintained unless they are overridden by a definition in windows

- existing ocPortal DST information will be considered correct unless my sanity check tools indicate otherwise (like with Caracas). This exercise is to correct the timezone list, not the DST info.

- there would no-doubt be a lot new row arrangements, resulting in a on-off change for many users (as you described by your bullet points). This could be mitigated during the upgrade patch by doing a once-off correction to users saved timezone info.


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#69728
Avatar

Excellent, works for me.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69731
Avatar

Community saint

Ok, will do then.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#70732
Avatar

Community saint

Finally found some time to finish the time zone list.

I decided to do the 'full' consolidation with the Windows time zones where I could easily reconcile with the ocPortal time zone data.

Note that although Windows uses UTC instead of GMT (and I think UTC probably should be the way to go), I left the list as GMT as I'm not sure if you would actually want that changed.

Expand: Updated timezone list #2 Updated timezone list #2


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#70735
Avatar

Community saint

36 years in the military evokes the term ZULU (or Z), which continues to be used as the base 'marker' in aviation and the military!

But UTC appears to be accepted as the official standard of world time (atomic), despite the fact that it is based on zero degrees longitude which passes through the Greenwich Observatory.

Not a subject for deep discussion, though; just clarification?

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#70759
Avatar

Community saint

No clarification needed, just not sure if Chris & co have any 'sentimental' type attachments given GMT's origins  :lol: .

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#70805
Avatar

Thanks very much, this will be in 7.1. I have used UTC.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: