Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
MisterBhoot
Posts: 4
Registered: ‎05-24-2013
My Device: Z10
My Carrier: Vodafone

Handling Daylight Saving Time in several time zones

[ Edited ]

I am working on an app that requires managing current time in several time zones, some of which might be on Daylight Saving Time.

Is there any API in BB10 Cascades which could offer me a graceful management, like BB10 itself can manage DST if I convert the current time to another time zone or something?

Or am I supposed to handle this manually, like keeping track of the UTC offsets, along the the frequently updated DST offsets?

Am I supposed to use the QDateTime for this?

 

In any case, could any one provide me some sample code, or any kind of pointers?

 

UPDATE:

In case I have to go all manual in this, I stumbled upon the database hosted at geonames.org. It provides free download of list of cities that also includes their respective time zone codes, time zone offsets and even daylight saving offsets. If this database happens to be accurate, then it will save me all those calculations.

Has anyone had any experience with this database? How accurate is it? How often is it updated?

MisterBhoot
Please use plain text.
Contributor
JUhrig
Posts: 31
Registered: ‎09-25-2012
My Device: N/A
My Carrier: Rogers

Re: Handling Daylight Saving Time in several time zones

Hey I found this helpful when dealing with local time to other time zones.

http://silmor.de/qtstuff.tzone.php
Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Handling Daylight Saving Time in several time zones

There must be an Olson database already on the device, because various system functions use it. It is even mentioned in the WebWorks documentation. I would check how current it is before relying on it.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
New Contributor
MisterBhoot
Posts: 4
Registered: ‎05-24-2013
My Device: Z10
My Carrier: Vodafone

Re: Handling Daylight Saving Time in several time zones

[ Edited ]

JUhrig wrote:
Hey I found this helpful when dealing with local time to other time zones.

http://silmor.de/qtstuff.tzone.php

I did stumble upon the site that you pointed to. While I am studying it, please have a look at my updated question.

MisterBhoot
Please use plain text.
New Contributor
MisterBhoot
Posts: 4
Registered: ‎05-24-2013
My Device: Z10
My Carrier: Vodafone

Re: Handling Daylight Saving Time in several time zones


Innovatology wrote:

There must be an Olson database already on the device, because various system functions use it. It is even mentioned in the WebWorks documentation. I would check how current it is before relying on it.


Olson database, or the newly-discovered geonames.org would be my choice, indeed. I wanted to see if anyone already knows how I can access the built-in BB10 database. Your concern about its currentness is valid. I think, however, it should be getting updated frequently through phone updates.
MisterBhoot
Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Handling Daylight Saving Time in several time zones

Timezone management seems to be missing from the API, i have also looked for it unsuccessfully.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: Handling Daylight Saving Time in several time zones

Geonames is updated quite regularly, but like other community projects it isn't always complete or accurate.

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.