-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Date format generated by formatRFC3339 is incompatible with Golang standard lib RFC3339! #1911
Comments
Same goes for formatISO! Am I doing something wrong?? |
hi @abhijit-kar, thanks for submitting this issue! Which version of date-fns did you use? The With regards to the It's also documented in https://tools.ietf.org/html/rfc3339#section-5.6, where |
I used latest 2.15.0 & prior 2.9.0 versions. That resulted in "2020-08-22T19:19:53+5.5:30" & "2020-08-22T19:23:02+5.5:30" respectively, both of which errored out when I fed them to Golang. |
Ah yes, my bad -- that PR only does the trick for I will go ahead and fix the |
I also proposed fix few weeks ago with tests for all other kinds of strange timezones: #1890 @abhijit-kar for a workaround until library with fix is released (not sure how urgent it's for you), just fork the function :) See fork I made:
|
It is fine Piotr, take your time. I will have to get lots of other things working, before I'll be needing this. I was merely making a POC, when I discovered this issue. |
Fixed in #1890 and released under v2.16.0 |
Isn't the issue related to the fact that method |
@RaVbaker what do you mean by "the server set timezone"? date-fns will always get timezone local to environment it runs function if you run this function on node.js - then it'll get value from server btw. I'd love to close this issue as it's done, but I don't have privileges :) |
The documentation for formatRFC3339 suggests following output in comment:
However, what it actually outputs is:
Which doesn't sit well with Golang standard lib, RFC3339 format!
Replace the prior date with later date in Go Playground and you'll see the issue.
P.S. I used StackBlitz to run date-fns.
The text was updated successfully, but these errors were encountered: