-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Parsing of ISO 8601 dates, originally from aeson
--   
--   Parsing of ISO 8601 dates, originally from aeson.
@package attoparsec-iso8601
@version 1.1.1.0


-- | Parsers for parsing dates and times.
module Data.Attoparsec.Time

-- | Parse a date of the form <tt>[+,-]YYYY-MM-DD</tt>.
--   
--   The year must contain at least 4 digits, to avoid the Y2K problem: a
--   two-digit year <tt>YY</tt> may mean <tt>YY</tt>, <tt>19YY</tt>, or
--   <tt>20YY</tt>, and we make it an error to prevent the ambiguity. Years
--   from <tt>0000</tt> to <tt>0999</tt> must thus be zero-padded. The year
--   may have more than 4 digits.
day :: Parser Day

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

-- | Parse a time of the form <tt>HH:MM[:SS[.SSS]]</tt>.
timeOfDay :: Parser TimeOfDay

-- | Parse a time zone, and return <a>Nothing</a> if the offset from UTC is
--   zero. (This makes some speedups possible.)
--   
--   The accepted formats are <tt>Z</tt>, <tt>+HH</tt>, <tt>+HHMM</tt>, or
--   <tt>+HH:MM</tt>.
timeZone :: Parser (Maybe TimeZone)

-- | Behaves as <a>zonedTime</a>, but converts any time zone offset into a
--   UTC time.
utcTime :: Parser UTCTime

-- | Parse a date with time zone info. Acceptable formats:
--   
--   <tt>YYYY-MM-DD HH:MM Z</tt> <tt>YYYY-MM-DD HH:MM:SS Z</tt>
--   <tt>YYYY-MM-DD HH:MM:SS.SSS Z</tt>
--   
--   The first space may instead be a <tt>T</tt>, and the second space is
--   optional. The <tt>Z</tt> represents UTC. The <tt>Z</tt> may be
--   replaced with a time zone offset of the form <tt>+0000</tt> or
--   <tt>-08:00</tt>, where the first two digits are hours, the <tt>:</tt>
--   is optional and the second two digits (also optional) are minutes.
zonedTime :: Parser ZonedTime

-- | Parse a year <tt>YYYY</tt>, with at least 4 digits. Does not include
--   any sign.
--   
--   Note: <a>Year</a> is a type synonym for <a>Integer</a>.
year :: Parser Year

-- | Parse a month of the form <tt>[+,-]YYYY-MM</tt>.
--   
--   See also <a>day</a> for details about the year format.
month :: Parser Month

-- | Parse a quarter of the form <tt>[+,-]YYYY-QN</tt>.
--   
--   See also <a>day</a> for details about the year format.
quarter :: Parser Quarter


module Data.Attoparsec.Time.Internal

-- | Like TimeOfDay, but using a fixed-width integer for seconds.
data TimeOfDay64
TOD :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int64 -> TimeOfDay64

-- | <i>Deprecated: Use MkFixed</i>
fromPico :: Pico -> Integer

-- | <i>Deprecated: Use MkFixed</i>
toPico :: Integer -> Pico
diffTimeOfDay64 :: DiffTime -> TimeOfDay64
toTimeOfDay64 :: TimeOfDay -> TimeOfDay64
