+
Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

timezone is ignored in the iso8601 conversion from string to date #85

@crarau

Description

@crarau

SwiftMoment ignores the timezone from an iso8601 string formatted date even if it's specified.

Example:
The code
print(moment("2017-02-09T03:17:52.477Z")!.format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX")) displays: 2017-02-09T03:17:52.477-05:00
the expected output is either 2017-02-09T03:17:52.477Z or 2017-02-08T22:17:52.477-05:00

from Wikipedia: If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载