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

Incorrect instance construction when using a timezone #343

Closed
coatesap opened this issue Jul 22, 2022 · 3 comments
Closed

Incorrect instance construction when using a timezone #343

coatesap opened this issue Jul 22, 2022 · 3 comments

Comments

@coatesap
Copy link
Contributor

The construction of a Spacetime instance seems to be affected by the system timezone, even when a specific timezone is supplied as the second parameter:

// system timezone set to Europe/London

spacetime('2022-10-30 00:00:00', 'America/New_York').epoch
// = 1667098800000 - wrong - should be: 1667102400000

spacetime('2022-10-30 00:00:00', 'America/New_York').format('iso-utc')
// = 2022-10-30T03:00:00.000Z - wrong - should be: 2022-10-30T04:00:00.000Z

This seems to being affected by the fact that in London there is a DST change on that day. But that should be irrelevant given that we've been explicit about what we mean in the constructor.

@spencermountain
Copy link
Owner

spencermountain commented Jul 22, 2022

hey Andy, could this be #235 ?
cheers

@coatesap
Copy link
Contributor Author

@spencermountain - Was this fixed as part of some other issue or branch?

@spencermountain
Copy link
Owner

Nope, still exists as #235 I’m afraid. Fix in the works but it’s taking time.

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

No branches or pull requests

2 participants