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


-- | Time library
--   
--   This package provides the old time library. For new code, the new time
--   library is recommended.
@package old-time
@version 1.0.0.6


-- | The standard time library from Haskell 98. This library is deprecated,
--   please look at <tt>Data.Time</tt> in the <tt>time</tt> package
--   instead.
--   
--   <a>System.Time</a> provides functionality for clock times, including
--   timezone information (i.e, the functionality of "<tt>time.h</tt>",
--   adapted to the Haskell environment). It follows RFC 1129 in its use of
--   Coordinated Universal Time (UTC).
module System.Time

-- | A representation of the internal clock time. Clock times may be
--   compared, converted to strings, or converted to an external calendar
--   time <a>CalendarTime</a> for I/O or other manipulations.
data ClockTime

-- | Construct a clock time. The arguments are a number of seconds since
--   00:00:00 (UTC) on 1 January 1970, and an additional number of
--   picoseconds.
--   
--   In Haskell 98, the <a>ClockTime</a> type is abstract.
TOD :: Integer -> Integer -> ClockTime
getClockTime :: IO ClockTime

-- | records the difference between two clock times in a user-readable way.
data TimeDiff
TimeDiff :: Int -> Int -> Int -> Int -> Int -> Int -> Integer -> TimeDiff
tdYear :: TimeDiff -> Int
tdMonth :: TimeDiff -> Int
tdDay :: TimeDiff -> Int
tdHour :: TimeDiff -> Int
tdMin :: TimeDiff -> Int
tdSec :: TimeDiff -> Int
tdPicosec :: TimeDiff -> Integer

-- | null time difference.
noTimeDiff :: TimeDiff

-- | <tt><a>diffClockTimes</a> t1 t2</tt> returns the difference between
--   two clock times <tt>t1</tt> and <tt>t2</tt> as a <a>TimeDiff</a>.
diffClockTimes :: ClockTime -> ClockTime -> TimeDiff

-- | <tt><a>addToClockTime</a> d t</tt> adds a time difference <tt>d</tt>
--   and a clock time <tt>t</tt> to yield a new clock time. The difference
--   <tt>d</tt> may be either positive or negative.
addToClockTime :: TimeDiff -> ClockTime -> ClockTime

-- | converts a time difference to normal form.
normalizeTimeDiff :: TimeDiff -> TimeDiff

-- | formats time differences using local conventions.
timeDiffToString :: TimeDiff -> String

-- | formats time differences using local conventions and a formatting
--   string. The formatting string is that understood by the ISO C
--   <tt>strftime()</tt> function.
formatTimeDiff :: TimeLocale -> String -> TimeDiff -> String

-- | <a>CalendarTime</a> is a user-readable and manipulable representation
--   of the internal <a>ClockTime</a> type.
data CalendarTime
CalendarTime :: Int -> Month -> Int -> Int -> Int -> Int -> Integer -> Day -> Int -> String -> Int -> Bool -> CalendarTime

-- | Year (pre-Gregorian dates are inaccurate)
ctYear :: CalendarTime -> Int

-- | Month of the year
ctMonth :: CalendarTime -> Month

-- | Day of the month (1 to 31)
ctDay :: CalendarTime -> Int

-- | Hour of the day (0 to 23)
ctHour :: CalendarTime -> Int

-- | Minutes (0 to 59)
ctMin :: CalendarTime -> Int

-- | Seconds (0 to 61, allowing for up to two leap seconds)
ctSec :: CalendarTime -> Int

-- | Picoseconds
ctPicosec :: CalendarTime -> Integer

-- | Day of the week
ctWDay :: CalendarTime -> Day

-- | Day of the year (0 to 364, or 365 in leap years)
ctYDay :: CalendarTime -> Int

-- | Name of the time zone
ctTZName :: CalendarTime -> String

-- | Variation from UTC in seconds
ctTZ :: CalendarTime -> Int

-- | <a>True</a> if Daylight Savings Time would be in effect, and
--   <a>False</a> otherwise
ctIsDST :: CalendarTime -> Bool

-- | A month of the year.
data Month
January :: Month
February :: Month
March :: Month
April :: Month
May :: Month
June :: Month
July :: Month
August :: Month
September :: Month
October :: Month
November :: Month
December :: Month

-- | A day of the week.
data Day
Sunday :: Day
Monday :: Day
Tuesday :: Day
Wednesday :: Day
Thursday :: Day
Friday :: Day
Saturday :: Day

-- | converts an internal clock time to a local time, modified by the
--   timezone and daylight savings time settings in force at the time of
--   conversion. Because of this dependence on the local environment,
--   <a>toCalendarTime</a> is in the <a>IO</a> monad.
toCalendarTime :: ClockTime -> IO CalendarTime

-- | converts an internal clock time into a <a>CalendarTime</a> in standard
--   UTC format.
toUTCTime :: ClockTime -> CalendarTime

-- | converts a <a>CalendarTime</a> into the corresponding internal
--   <a>ClockTime</a>, ignoring the contents of the <a>ctWDay</a>,
--   <a>ctYDay</a>, <a>ctTZName</a> and <a>ctIsDST</a> fields.
toClockTime :: CalendarTime -> ClockTime

-- | formats calendar times using local conventions.
calendarTimeToString :: CalendarTime -> String

-- | formats calendar times using local conventions and a formatting
--   string. The formatting string is that understood by the ISO C
--   <tt>strftime()</tt> function.
formatCalendarTime :: TimeLocale -> String -> CalendarTime -> String
instance Eq Month
instance Ord Month
instance Enum Month
instance Bounded Month
instance Ix Month
instance Read Month
instance Show Month
instance Eq Day
instance Ord Day
instance Enum Day
instance Bounded Day
instance Ix Day
instance Read Day
instance Show Day
instance Eq ClockTime
instance Ord ClockTime
instance Eq CalendarTime
instance Ord CalendarTime
instance Read CalendarTime
instance Show CalendarTime
instance Eq TimeDiff
instance Ord TimeDiff
instance Read TimeDiff
instance Show TimeDiff
instance Show ClockTime
