hodatime
Copyright(C) 2017 Jason Johnson
LicenseBSD-style (see the file LICENSE)
MaintainerJason Johnson <jason.johnson.081@gmail.com>
Stabilityexperimental
PortabilityPOSIX, Windows
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HodaTime.Pattern.Instant

Description

Patterns for an Instant, rendered as ISO-8601 UTC (yyyy-MM-ddTHH:mm:ssZ); pInstantNano additionally carries the fractional second down to the nanosecond.

Synopsis

Standard Patterns

pInstant :: Pattern (Instant -> Instant) (Instant -> String) String Source #

The ISO-8601 UTC instant pattern, yyyy-MM-ddTHH:mm:ssZ (the trailing Z marks it as UTC).

pInstantNano :: Pattern (Instant -> Instant) (Instant -> String) String Source #

Like pInstant but carried down to the nanosecond, yyyy-MM-ddTHH:mm:ss.fffffffffZ.

Custom Patterns

Build an Instant pattern from any Gregorian CalendarDateTime pattern, treating the instant as UTC.

instantPattern :: Pattern (CalendarDateTime Gregorian -> CalendarDateTime Gregorian) (CalendarDateTime Gregorian -> String) String -> Pattern (Instant -> Instant) (Instant -> String) String Source #

Adapt a Gregorian CalendarDateTime pattern into an Instant pattern. The instant is treated as UTC: it is projected to its unadjusted Gregorian CalendarDateTime for formatting, and the parsed CalendarDateTime is taken back to an Instant without any offset.