-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DateFormat cannot parse time zones #16801
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
Comments
Added Library-Core, Triaged labels. |
Added Area-Library label. |
Removed Library-Core, Area-Library labels. |
The problem is that the time zone specification is ignored by the reader. It's ignored by the reader because there is no way to set it on a DateTime. Dart's DateTime objects currently exist only in either UTC or in what it thinks is the local time zone of the machine. Merging this with extending and specifying the format for what can be parsed in DateTime creation. Added Duplicate label. |
This issue has been moved to dart-lang/i18n#345. |
This issue was originally filed by [email protected]
What steps will reproduce the problem?
test('> parseForIssueReport', () {
final DateFormat rfc822Formatter = new DateFormat("EEE, dd MMM yyyy HH:mm:ss Z","en_US");
final DateTime dt = rfc822Formatter.parse("Wed, 02 Oct 2002 15:00:00 +0230");
expect(dt.timeZoneOffset.inMinutes, 150);
}); // end of 'parseForIssueReport' test
What is the expected output? What do you see instead?
+230 should be 150 minutes!
What version of the product are you using? On what operating system?
Dart SDK 1.1.3 + intl 0.9.4
The text was updated successfully, but these errors were encountered: