Z-Data-2.0.1.0: Array, vector and text
Copyright(c) 2015-2016 Bryan O'Sullivan
(c) 2020 Dong Han
LicenseBSD3
MaintainerDong <winterland1989@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Z.Data.Parser.Time

Contents

Description

Parsers for parsing dates and times.

Synopsis

Documentation

day :: Parser Day Source #

Parse a date of the form [+,-]YYYY-MM-DD.

Invalid date(leap year rule violation, etc.) will be rejected.

localTime :: Parser LocalTime Source #

Parse a date and time, of the form YYYY-MM-DD HH:MM[:SS[.SSS]]. The space may be replaced with a T. The number of seconds is optional and may be followed by a fractional component.

timeOfDay :: Parser TimeOfDay Source #

Parse a time of the form HH:MM[:SS[.SSS]].

timeZone :: Parser (Maybe TimeZone) Source #

Parse a time zone, and return Nothing if the offset from UTC is zero. (This makes some speedups possible.)

utcTime :: Parser UTCTime Source #

Behaves as zonedTime, but converts any time zone offset into a -- UTC time.

zonedTime :: Parser ZonedTime Source #

Parse a date with time zone info. Acceptable formats:

  YYYY-MM-DD HH:MM Z
  YYYY-MM-DD HH:MM:SS Z
  YYYY-MM-DD HH:MM:SS.SSS Z

The first space may instead be a T, and the second space is optional. The Z represents UTC. The Z may be replaced with a time zone offset of the form +0000 or -08:00, where the first two digits are hours, the : is optional and the second two digits (also optional) are minutes.

internal

fromGregorianValidInt64 :: Int64 -> Int -> Int -> Maybe Day Source #

Faster common case for small years(around -18000000000000000 ~ 18000000000000000).