Skip to content

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

Closed
DartBot opened this issue Feb 13, 2014 · 6 comments
Closed

DateFormat cannot parse time zones #16801

DartBot opened this issue Feb 13, 2014 · 6 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report

Comments

@DartBot
Copy link

DartBot commented Feb 13, 2014

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

@kevmoo
Copy link
Member

kevmoo commented Feb 13, 2014

Added Library-Core, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Feb 16, 2014

Added Area-Library label.

@lrhn
Copy link
Member

lrhn commented Feb 16, 2014

Removed Library-Core, Area-Library labels.
Added pkg-intl, Area-Pkg labels.

@lrhn
Copy link
Member

lrhn commented Feb 17, 2014

Removed pkg-intl label.
Added Pkg-Intl label.

@alan-knight
Copy link
Contributor

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.
Marked as being merged into #1878.
Changed the title to: "DateFormat cannot parse time zones".

@DartBot DartBot added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report labels May 12, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/i18n#345.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

4 participants