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


-- | Parsers for types in `time`.
--   
--   Parsers for types in <a>time</a> using <a>parser</a> library.
--   
--   Originally forked from aeson parsers.
@package time-parsers
@version 0.1.2.0


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

-- | Parse a date of the form <tt>YYYY-MM-DD</tt>.
day :: DateParsing m => m Day

-- | Parse a month of the form <tt>YYYY-MM</tt>
month :: DateParsing m => m (Integer, Int)

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

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

-- | Parse a time zone, and return <a>Nothing</a> if the offset from UTC is
--   zero. (This makes some speedups possible.)
timeZone :: DateParsing m => m (Maybe TimeZone)

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

-- | Parse a date with time zone info. Acceptable formats:
--   
--   <pre>
--   YYYY-MM-DD HH:MM:SS Z
--   </pre>
--   
--   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 :: DateParsing m => m ZonedTime
type DateParsing m = (CharParsing m, LookAheadParsing m, Monad m)


-- | Template Haskell extras for <a>Time</a>.
module Data.Time.TH

-- | Make a <a>UTCTime</a>. Accepts the same strings as <a>utcTime</a>
--   parser accepts.
--   
--   <pre>
--   t :: UTCTime
--   t = $(mkUTCTime "2014-05-12 00:02:03.456000Z")
--   </pre>
mkUTCTime :: String -> Q Exp

-- | Make a <a>Day</a>. Accepts the same strings as <a>day</a> parser
--   accepts.
--   
--   <pre>
--   d :: Day
--   d = $(mkDay "2014-05-12")
--   </pre>
mkDay :: String -> Q Exp
