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

Feature Request: Historical timezone data #88

Open
wclr opened this issue Jan 21, 2019 · 10 comments
Open

Feature Request: Historical timezone data #88

wclr opened this issue Jan 21, 2019 · 10 comments

Comments

@wclr
Copy link

wclr commented Jan 21, 2019

So if I see it right this library doesn't use tz database full data that is used by https://momentjs.com/timezone/ and thus can not be used for historical dates, is spacetime intended only for current moment dates conversions?

@spencermountain
Copy link
Owner

yes, that's correct. I think there are some no-longer-used timezones in our list, but yes, we only record their latest offset+dst change.
I thought i had written that somewhere in the docs, but it appears I haven't. will keep this open until i update it.
cheers

@wclr
Copy link
Author

wclr commented Jan 22, 2019

Don't you want to change add this capability (as optional)? This would make spacetime more universal, allowing to use it in projects that work with historical dates.

@spencermountain spencermountain changed the title Using tz-database data Feature Request: Historical timezone data Jan 22, 2019
@spencermountain
Copy link
Owner

yeah, it gets pretty complex, the further-back you go.
it would also dramatically increase the size of the library

@ryanblock
Copy link
Contributor

To further @spencermountain’s point, the entire reason we created Spacetime at @smallwins was because date/time libraries with full historical databases were too large and slow and clunky. So this suggestion kind of negates the whole point of the thing. Perhaps check out Moment, @whitecolor?

@wclr
Copy link
Author

wclr commented Jan 23, 2019

Well, probably there could be created a separate package that would hold the database and use spacetime as a dependency.

@ryanblock I use moment-timezone, it requires moment that I don't use) that is not a huge problem actually, it can be overcome.

I just thought that spacetime as the project could have such a capability.

@spencermountain
Copy link
Owner

been thinking about this a little, and it'd be fun to implement in a separate package somehow.

if you run this, you'll see most computers (mine, atleast) have dst-change info back as far as 1900:

zdump -v /usr/share/zoneinfo/canada/pacific

it'd be fun to turn this into a cleaner json diff, and see how small we can make it.

I guess the names/ids of tzs change too, so stalingrad time in 1992 would have some weird edges, and things like this.

if anyone wants to work on it with me, holler.

@Fellach
Copy link

Fellach commented Apr 30, 2019

Hi @spencermountain

What do you mean by no-longer-used timezones? All deprecated on the IANA list?

I've got an error Cannot find timezone named: 'US/Pacific' and not sure is a bug or feature.

Love your work, greetz!

@spencermountain
Copy link
Owner

@Fellach good question. I think we should include deprecated IANA zones. We have most of them now, i believe. Happy to add 'US/Pacific', and any others from that list.

I'm working on softening things up in a seperate lib for reconciling timezones, like 'India' or 'San Fransisco'. That can be where we put the long-tail, real weird timezones, going forward.
cheers

@johnfumaster
Copy link

Yeah, I've also been getting invalid IANA timezone for 'cet'. Strange enough, when I wrote a unit test to cover this, it doesn't complain. I've also tried putting it through informal.find and still I get this error sometimes.

@spencermountain
Copy link
Owner

agh weird. Yeah, spacetime-informal should be able to convert 'cet' to UTC+3.
I'd really like to know why you're getting such unreliable results!
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants