Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query historical speeds with timezone/daylight_saving offset #220

Closed
wangyoucao577 opened this issue Mar 11, 2020 · 2 comments
Closed

Query historical speeds with timezone/daylight_saving offset #220

wangyoucao577 opened this issue Mar 11, 2020 · 2 comments
Assignees
Labels
NewFeature New feature or feature improvement Prototype Proof of concept

Comments

@wangyoucao577
Copy link

Ususally we'll query historical speeds by UTC time, but the data of historical speeds are local time. This issue is target to solve this issue: either convert UTC to localtime when querying or pre-offset the data in memory by timezone when loading.
The daylight_saving is more complex, which may have to be done when query.

This a subtask of #150.

@wangyoucao577
Copy link
Author

OSM stores one timezone field with content tz database name (e.g., “Africa/Abidjan”).

It’s a open standard and uses widely. Also, it’s very easy to handle by many different languages/libraries(https://en.wikipedia.org/wiki/Tz_database#Use_in_software_systems).
I have had a quick try on both Golang and Python, both of them can convert time to another timezone by one line.
Here’s some code snippet by Python:

>>> utc_dt.strftime(fmt)
'2006-03-26 21:34:59 UTC+0000'
>>> au_tz = timezone('Australia/Sydney')
>>> au_dt = utc_dt.astimezone(au_tz)
>>> au_dt.strftime(fmt)
'2006-03-27 08:34:59 AEDT+1100'

After internal discussion, unidb will provide the tz_database_name too to easy the converting, then caller don't need to handle the daylight saving details. This task will be postponed until the tz_database_name provided.

@wangyoucao577 wangyoucao577 removed the InProgress Currently working on it label Apr 8, 2020
@wangyoucao577
Copy link
Author

Since there's almost no timezone data in OSM(only hundreds in Global, which is too less), I think support it for OSM now is meaningless. I'd like to close this issue and move the unidb timezone support into internal development.
We may come up this issue again once OSM provides sufficient timezone information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NewFeature New feature or feature improvement Prototype Proof of concept
Projects
None yet
Development

No branches or pull requests

1 participant