On this page
Data.Time.LocalTime
Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Contents
Time zones
A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.
Constructors
TimeZone | |
Fields
|
Instances
timeZoneOffsetString :: TimeZone -> String Source
Text representing the offset of this timezone, such as "-0800" or "+0400" (like %z in formatTime)
timeZoneOffsetString' :: NumericPadOption -> TimeZone -> String Source
Text representing the offset of this timezone, such as "-0800" or "+0400" (like %z in formatTime), with arbitrary padding
minutesToTimeZone :: Int -> TimeZone Source
Create a nameless non-summer timezone for this number of minutes
hoursToTimeZone :: Int -> TimeZone Source
Create a nameless non-summer timezone for this number of hours
The UTC time zone
getTimeZone :: UTCTime -> IO TimeZone Source
Get the local time-zone for a given time (varying as per summertime adjustments)
getCurrentTimeZone :: IO TimeZone Source
Get the current time-zone
Time of day
Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.
Constructors
Instances
Hour zero
Hour twelve
makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay Source
utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay) Source
Convert a ToD in UTC to a ToD in some timezone, together with a day adjustment.
localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay) Source
Convert a ToD in some timezone to a ToD in UTC, together with a day adjustment.
timeToTimeOfDay :: DiffTime -> TimeOfDay Source
Get a TimeOfDay given a time since midnight. Time more than 24h will be converted to leap-seconds.
timeOfDayToTime :: TimeOfDay -> DiffTime Source
Find out how much time since midnight a given TimeOfDay is.
dayFractionToTimeOfDay :: Rational -> TimeOfDay Source
Get a TimeOfDay given the fraction of a day since midnight.
timeOfDayToDayFraction :: TimeOfDay -> Rational Source
Get the fraction of a day since midnight given a TimeOfDay.
Local Time
A simple day and time aggregate, where the day is of the specified parameter, and the time is a TimeOfDay. Conversion of this (as local civil time) to UTC depends on the time zone. Conversion of this (as local mean time) to UT1 depends on the longitude.
Constructors
LocalTime | |
Fields
|
Instances
utcToLocalTime :: TimeZone -> UTCTime -> LocalTime Source
show a UTC time in a given time zone as a LocalTime
localTimeToUTC :: TimeZone -> LocalTime -> UTCTime Source
find out what UTC time a given LocalTime in a given time zone is
ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime Source
1st arg is observation meridian in degrees, positive is East
localTimeToUT1 :: Rational -> LocalTime -> UniversalTime Source
1st arg is observation meridian in degrees, positive is East
A local time together with a TimeZone.
Constructors
ZonedTime | |
Fields |
utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime Source
zonedTimeToUTC :: ZonedTime -> UTCTime Source
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/7.10.3/docs/html/libraries/time-1.5.0.1/Data-Time-LocalTime.html