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

formatISO omitting final Z character in dates #1559

Closed
aryzing opened this issue Dec 9, 2019 · 5 comments · Fixed by #1576
Closed

formatISO omitting final Z character in dates #1559

aryzing opened this issue Dec 9, 2019 · 5 comments · Fixed by #1576
Assignees

Comments

@aryzing
Copy link

aryzing commented Dec 9, 2019

An ISO date should have either a time offset or Z appended to the end. Omitting this Z character causes the date as being relative to the host machine's timezone. When performing operations across time zones, this is problematic.

@jpodpro
Copy link

jpodpro commented Dec 18, 2019

just noticing this too. isn't the whole point of iso8601 that it must have a time-zone specified also?

@imballinst
Copy link
Contributor

imballinst commented Dec 18, 2019

Hmm, back then we only took the date, time, and datetime as the scope (see http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm). We can add timezone if it is needed. WDYT @leshakoss?

I think the reason we thought that it was okay to omit timezone because ISO8601 is mostly in UTC (?)

EDIT: nvm I was silly.

@kossnocorp
Copy link
Member

I believe the full output should contain the timezone. I didn't think about that when I was looking at the PR. Not sure how it fits the API though.

@imballinst
Copy link
Contributor

imballinst commented Dec 20, 2019

I can work on this issue, this weekend. My plan is if the passed option is extended (which is the default one), we show the timezone as well.

@cyberwombat
Copy link

Perhaps along the same lines - doesn't seem possible to use format with UTC either. See this SO post https://stackoverflow.com/questions/58561169/date-fns-how-do-i-format-to-utc

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

Successfully merging a pull request may close this issue.

5 participants