Skip to content

Parsing ISO 8601 / RFC 3339 datetime string? #44

Description

@Boscop

What's the correct way to parse a ISO 8601 / RFC 3339 datetime string?
This is very common in json communication.
On the server side we are using Rust for our API and DateTime::to_rfc3339() to convert the datetimes to String for the json API, which can also be expressed with the format string "%+":
> %+: Same to %Y-%m-%dT%H:%M:%S%.f%:z, i.e. 0, 3, 6 or 9 fractional digits for seconds and colons in the time zone offset.

So it has a variable number of digits for the fractional seconds, depending on the timestamp in question.
If it falls on a second boundary, it has 0 fractional second digits, like "1970-01-01T00:00:00+00:00".
Also it has the timezone at the end.

How can I parse this ISO 8601 / RFC 3339 datetime string in my PureScript frontend?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions