8000 Parsing String + Format doesn't handle timezone · Issue #147 · moment/moment · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Parsing String + Format doesn't handle timezone #147
Closed
@deepwell

Description

@deepwell

Parsing an email date string doesn't work by default:

var email_date = "Mon, 23 Jan 2012 08:36:10 -0500";
moment(email_date);

Outputs: 2012-01-23 05:36:10
Expected: 2012-01-23 13:36:10

So I decided to specify the format, but that doesn't work either, maybe I'm doing it wrong:
var email_date = "Mon, 23 Jan 2012 08:36:10 -0500";
moment(email_date, "ddd, DD MM YYYY h:m:s ZZ");

Output: 2011-12-22 19:36:10
Expected: 2012-01-23 13:36:10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0