-
Notifications
You must be signed in to change notification settings - Fork 124
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
Jiffy.parse
ignores Z
timezone suffix in ISO 8601 date/time string
#281
Comments
Hey @lukehutch , that's correct. By default, Jiffy parses the timestamp as local time. To parse a UTC string as UTC, you need to tell final timestampUtc = '2024-07-02T08:07:50Z';
final c = Jiffy.parse(timestampUtc, isUtc: true);
print(c.isUtc); // this will print true You can find more info about string parsing here https://github.com/jama5262/jiffy/tree/master/doc#string-formatting Hope this solves your issue |
Please do reopen this issue if the above solution did not solve your problem |
@jama5262 then Jiffy does not conform to even a useful subset of the ISO 8601 standard! And the user does not even get a warning that their date was parsed wrongly. The I don't have a way to reopen this, but it needs to be reopened. This is a horrible bug, and the "solution" is not a solution. If you insist that Jiffy should not detect the |
@lukehutch Understandable, yeah Jiffy should automatically detect it Will work on a fix 👍 |
ISO 8601 is a large standard, but this is an important part of it. Since you agreed to work on a fix (thank you), the other important part is to parse the |
Describe the bug
In
c
, the timezone is missing, even though theZ
suffix is present in the stringtimestamp
.Consequently, the
DateTime
is created in the local timezone (by the looks of it). This leads to conversion to UTC being wrong (d
).Jiffy 6.3.1.
The text was updated successfully, but these errors were encountered: