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

Format with tz gives incorrect offset #168

Closed
addepaddepro opened this issue Mar 8, 2022 · 1 comment
Closed

Format with tz gives incorrect offset #168

addepaddepro opened this issue Mar 8, 2022 · 1 comment

Comments

@addepaddepro
Copy link

addepaddepro commented Mar 8, 2022

When I try to format a really old date with timezone I get an incorrect offset with decimals.

const UTC = -24298794732001;

console.log(
  format(UTC, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx", {
    timeZone: "Europe/Stockholm"
  })
);

This is what I get and want it should be:

1200-01-01T23:59:59.999+01:12.200000000000003 
^ This should be: 1200-01-01T23:59:59.999+01:12 

Here is a Codesandbox with the issue:
https://codesandbox.io/s/pensive-babbage-3lnzts?file=/src/index.js

Does anyone have a solution for this?

@marnusw
Copy link
Owner

marnusw commented Mar 25, 2022

Fixed in #169 and released in 1.3.1

@marnusw marnusw closed this as completed Mar 25, 2022
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