rio-0.1.22.0: A standard library for Haskell

Safe Haskell | Safe-Inferred
Language | Haskell2010

RIO.Time

Synopsis

- data CalendarDiffDays = CalendarDiffDays {
  - cdMonths :: Integer
  - cdDays :: Integer
  }
- class Ord p => DayPeriod p where
  - periodFirstDay :: p -> Day
  - periodLastDay :: p -> Day
  - dayPeriod :: Day -> p
- newtype Day = ModifiedJulianDay {
  - toModifiedJulianDay :: Integer
  }
- type DayOfMonth = Int
- type MonthOfYear = Int
- type Year = Integer
- data DayOfWeek
  - = Monday
  - | Tuesday
  - | Wednesday
  - | Thursday
  - | Friday
  - | Saturday
  - | Sunday
- data DiffTime
- data NominalDiffTime
- data UTCTime = UTCTime {
  - utctDay :: Day
  - utctDayTime :: DiffTime
  }
- newtype UniversalTime = ModJulianDate {
  - getModJulianDate :: Rational
  }
- data CalendarDiffTime = CalendarDiffTime {
  - ctMonths :: Integer
  - ctTime :: NominalDiffTime
  }
- data TimeZone = TimeZone {
  - timeZoneMinutes :: Int
  - timeZoneSummerOnly :: Bool
  - timeZoneName :: String
  }
- data TimeOfDay = TimeOfDay {
  - todHour :: Int
  - todMin :: Int
  - todSec :: Pico
  }
- data LocalTime = LocalTime {
  - localDay :: Day
  - localTimeOfDay :: TimeOfDay
  }
- data TimeLocale = TimeLocale {
  - wDays :: [(String, String)]
  - months :: [(String, String)]
  - amPm :: (String, String)
  - dateTimeFmt :: String
  - dateFmt :: String
  - timeFmt :: String
  - time12Fmt :: String
  - knownTimeZones :: [TimeZone]
  }
- class ParseTime t
- class FormatTime t
- data ZonedTime = ZonedTime {
  - zonedTimeToLocalTime :: LocalTime
  - zonedTimeZone :: TimeZone
  }
- pattern May :: MonthOfYear
- pattern December :: MonthOfYear
- pattern November :: MonthOfYear
- pattern October :: MonthOfYear
- pattern September :: MonthOfYear
- pattern August :: MonthOfYear
- pattern July :: MonthOfYear
- pattern June :: MonthOfYear
- pattern April :: MonthOfYear
- pattern March :: MonthOfYear
- pattern February :: MonthOfYear
- pattern January :: MonthOfYear
- pattern BeforeCommonEra :: Integer -> Year
- pattern CommonEra :: Integer -> Year
- pattern YearMonthDay :: Year -> MonthOfYear -> DayOfMonth -> Day
- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- fromGregorian :: Year -> MonthOfYear -> DayOfMonth -> Day
- calendarDay :: CalendarDiffDays
- calendarWeek :: CalendarDiffDays
- calendarMonth :: CalendarDiffDays
- calendarYear :: CalendarDiffDays
- scaleCalendarDiffDays :: Integer -> CalendarDiffDays -> CalendarDiffDays
- addDays :: Integer -> Day -> Day
- diffDays :: Day -> Day -> Integer
- periodAllDays :: DayPeriod p => p -> [Day]
- periodLength :: DayPeriod p => p -> Int
- periodFromDay :: DayPeriod p => Day -> (p, Int)
- periodToDay :: DayPeriod p => p -> Int -> Day
- periodToDayValid :: DayPeriod p => p -> Int -> Maybe Day
- isLeapYear :: Year -> Bool
- toGregorian :: Day -> (Year, MonthOfYear, DayOfMonth)
- fromGregorianValid :: Year -> MonthOfYear -> DayOfMonth -> Maybe Day
- showGregorian :: Day -> String
- gregorianMonthLength :: Year -> MonthOfYear -> DayOfMonth
- addGregorianMonthsClip :: Integer -> Day -> Day
- addGregorianMonthsRollOver :: Integer -> Day -> Day
- addGregorianYearsClip :: Integer -> Day -> Day
- addGregorianYearsRollOver :: Integer -> Day -> Day
- addGregorianDurationClip :: CalendarDiffDays -> Day -> Day
- addGregorianDurationRollOver :: CalendarDiffDays -> Day -> Day
- diffGregorianDurationClip :: Day -> Day -> CalendarDiffDays
- diffGregorianDurationRollOver :: Day -> Day -> CalendarDiffDays
- dayOfWeek :: Day -> DayOfWeek
- dayOfWeekDiff :: DayOfWeek -> DayOfWeek -> Int
- firstDayOfWeekOnAfter :: DayOfWeek -> Day -> Day
- weekAllDays :: DayOfWeek -> Day -> [Day]
- weekFirstDay :: DayOfWeek -> Day -> Day
- weekLastDay :: DayOfWeek -> Day -> Day
- secondsToDiffTime :: Integer -> DiffTime
- picosecondsToDiffTime :: Integer -> DiffTime
- diffTimeToPicoseconds :: DiffTime -> Integer
- secondsToNominalDiffTime :: Pico -> NominalDiffTime
- nominalDiffTimeToSeconds :: NominalDiffTime -> Pico
- nominalDay :: NominalDiffTime
- getTime_resolution :: DiffTime
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime
- calendarTimeTime :: NominalDiffTime -> CalendarDiffTime
- scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime
- minutesToTimeZone :: Int -> TimeZone
- hoursToTimeZone :: Int -> TimeZone
- timeZoneOffsetString' :: Maybe Char -> TimeZone -> String
- timeZoneOffsetString :: TimeZone -> String
- utc :: TimeZone
- midnight :: TimeOfDay
- midday :: TimeOfDay
- makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay
- timeToDaysAndTimeOfDay :: NominalDiffTime -> (Integer, TimeOfDay)
- daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime
- utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- timeToTimeOfDay :: DiffTime -> TimeOfDay
- pastMidnight :: DiffTime -> TimeOfDay
- timeOfDayToTime :: TimeOfDay -> DiffTime
- sinceMidnight :: TimeOfDay -> DiffTime
- dayFractionToTimeOfDay :: Rational -> TimeOfDay
- timeOfDayToDayFraction :: TimeOfDay -> Rational
- addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime
- diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime
- utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
- localTimeToUTC :: TimeZone -> LocalTime -> UTCTime
- ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime
- localTimeToUT1 :: Rational -> LocalTime -> UniversalTime
- defaultTimeLocale :: TimeLocale
- iso8601DateFormat :: Maybe String -> String
- rfc822DateFormat :: String
- utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
- zonedTimeToUTC :: ZonedTime -> UTCTime
- parseTimeM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
- parseTimeMultipleM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> [(String, String)] -> m t
- parseTimeOrError :: ParseTime t => Bool -> TimeLocale -> String -> String -> t
- readSTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadS t
- readPTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadP t
- getCurrentTime :: MonadIO m => m UTCTime
- getTimeZone :: MonadIO m => UTCTime -> m TimeZone
- getCurrentTimeZone :: MonadIO m => m TimeZone
- getZonedTime :: MonadIO m => m ZonedTime
- utcToLocalZonedTime :: MonadIO m => UTCTime -> m ZonedTime

# Documentation

data CalendarDiffDays Source #

Constructors

CalendarDiffDays |

Fields

- cdMonths :: Integer
- cdDays :: Integer

#### Instances

Instances details

Data CalendarDiffDays | Since: time-1.9.2

Instance details

Defined in Data.Time.Calendar.CalendarDiffDays

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CalendarDiffDays -> c CalendarDiffDays Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CalendarDiffDays Source #

toConstr :: CalendarDiffDays -> Constr Source #

dataTypeOf :: CalendarDiffDays -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CalendarDiffDays) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CalendarDiffDays) Source #

gmapT :: (forall b. Data b => b -> b) -> CalendarDiffDays -> CalendarDiffDays Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffDays -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffDays -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CalendarDiffDays -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CalendarDiffDays -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CalendarDiffDays -> m CalendarDiffDays Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffDays -> m CalendarDiffDays Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffDays -> m CalendarDiffDays Source #

Monoid CalendarDiffDays | Additive
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods mempty :: CalendarDiffDays Source # mappend :: CalendarDiffDays -> CalendarDiffDays -> CalendarDiffDays Source # mconcat :: [CalendarDiffDays] -> CalendarDiffDays Source #
Semigroup CalendarDiffDays | Additive
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods (<>) :: CalendarDiffDays -> CalendarDiffDays -> CalendarDiffDays Source # sconcat :: NonEmpty CalendarDiffDays -> CalendarDiffDays Source # stimes :: Integral b => b -> CalendarDiffDays -> CalendarDiffDays Source #
Show CalendarDiffDays |
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods showsPrec :: Int -> CalendarDiffDays -> ShowS Source # show :: CalendarDiffDays -> String Source # showList :: [CalendarDiffDays] -> ShowS Source #
NFData CalendarDiffDays |
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods rnf :: CalendarDiffDays -> () Source #
Eq CalendarDiffDays |
Instance details Defined in Data.Time.Calendar.CalendarDiffDays Methods (==) :: CalendarDiffDays -> CalendarDiffDays -> Bool Source # (/=) :: CalendarDiffDays -> CalendarDiffDays -> Bool Source #

class Ord p => DayPeriod p where Source #

The class of types which can be represented as a period of days.

Since: time-1.12.1

Methods

periodFirstDay :: p -> Day Source #

Returns the first `Day` in a period of days.

periodLastDay :: p -> Day Source #

Returns the last `Day` in a period of days.

dayPeriod :: Day -> p Source #

Get the period this day is in.

#### Instances

Instances details

DayPeriod Day |
Instance details Defined in Data.Time.Calendar.Days Methods periodFirstDay :: Day -> Day Source # periodLastDay :: Day -> Day Source # dayPeriod :: Day -> Day Source #

newtype Day Source #

The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.

Constructors

ModifiedJulianDay |

Fields

- toModifiedJulianDay :: Integer

#### Instances

Instances details

Data Day |

Instance details

Defined in Data.Time.Calendar.Days

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day Source #

toConstr :: Day -> Constr Source #

dataTypeOf :: Day -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Day) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) Source #

gmapT :: (forall b. Data b => b -> b) -> Day -> Day Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

Enum Day |
Instance details Defined in Data.Time.Calendar.Days Methods succ :: Day -> Day Source # pred :: Day -> Day Source # toEnum :: Int -> Day Source # fromEnum :: Day -> Int Source # enumFrom :: Day -> [Day] Source # enumFromThen :: Day -> Day -> [Day] Source # enumFromTo :: Day -> Day -> [Day] Source # enumFromThenTo :: Day -> Day -> Day -> [Day] Source #
Ix Day |
Instance details Defined in Data.Time.Calendar.Days Methods range :: (Day, Day) -> [Day] Source # index :: (Day, Day) -> Day -> Int Source # unsafeIndex :: (Day, Day) -> Day -> Int Source # inRange :: (Day, Day) -> Day -> Bool Source # rangeSize :: (Day, Day) -> Int Source # unsafeRangeSize :: (Day, Day) -> Int Source #
NFData Day |
Instance details Defined in Data.Time.Calendar.Days Methods rnf :: Day -> () Source #
Eq Day |
Instance details Defined in Data.Time.Calendar.Days Methods (==) :: Day -> Day -> Bool Source # (/=) :: Day -> Day -> Bool Source #
Ord Day |
Instance details Defined in Data.Time.Calendar.Days Methods compare :: Day -> Day -> Ordering Source # (<) :: Day -> Day -> Bool Source # (<=) :: Day -> Day -> Bool Source # (>) :: Day -> Day -> Bool Source # (>=) :: Day -> Day -> Bool Source # max :: Day -> Day -> Day Source # min :: Day -> Day -> Day Source #
DayPeriod Day |
Instance details Defined in Data.Time.Calendar.Days Methods periodFirstDay :: Day -> Day Source # periodLastDay :: Day -> Day Source # dayPeriod :: Day -> Day Source #

type DayOfMonth = Int Source #

Day of month, in range 1 to 31.

type MonthOfYear = Int Source #

Month of year, in range 1 (January) to 12 (December).

type Year = Integer Source #

Year of Common Era (when positive).

data DayOfWeek Source #

Constructors

Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
Sunday |

#### Instances

Instances details

Data DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DayOfWeek -> c DayOfWeek Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DayOfWeek Source #

toConstr :: DayOfWeek -> Constr Source #

dataTypeOf :: DayOfWeek -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DayOfWeek) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DayOfWeek) Source #

gmapT :: (forall b. Data b => b -> b) -> DayOfWeek -> DayOfWeek Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DayOfWeek -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DayOfWeek -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DayOfWeek -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DayOfWeek -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DayOfWeek -> m DayOfWeek Source #

Enum DayOfWeek | "Circular", so for example `[Tuesday ..]` gives an endless sequence. Also: `fromEnum` gives [1 .. 7] for [Monday .. Sunday], and `toEnum` performs mod 7 to give a cycle of days.

Instance details

Defined in Data.Time.Calendar.Week

Methods

succ :: DayOfWeek -> DayOfWeek Source #

pred :: DayOfWeek -> DayOfWeek Source #

toEnum :: Int -> DayOfWeek Source #

fromEnum :: DayOfWeek -> Int Source #

enumFrom :: DayOfWeek -> [DayOfWeek] Source #

enumFromThen :: DayOfWeek -> DayOfWeek -> [DayOfWeek] Source #

enumFromTo :: DayOfWeek -> DayOfWeek -> [DayOfWeek] Source #

enumFromThenTo :: DayOfWeek -> DayOfWeek -> DayOfWeek -> [DayOfWeek] Source #

Ix DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

range :: (DayOfWeek, DayOfWeek) -> [DayOfWeek] Source #

index :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Int Source #

unsafeIndex :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Int Source #

inRange :: (DayOfWeek, DayOfWeek) -> DayOfWeek -> Bool Source #

rangeSize :: (DayOfWeek, DayOfWeek) -> Int Source #

unsafeRangeSize :: (DayOfWeek, DayOfWeek) -> Int Source #

Read DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods readsPrec :: Int -> ReadS DayOfWeek Source # readList :: ReadS [DayOfWeek] Source # readPrec :: ReadPrec DayOfWeek Source # readListPrec :: ReadPrec [DayOfWeek] Source #
Show DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods showsPrec :: Int -> DayOfWeek -> ShowS Source # show :: DayOfWeek -> String Source # showList :: [DayOfWeek] -> ShowS Source #
NFData DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods rnf :: DayOfWeek -> () Source #
Eq DayOfWeek |
Instance details Defined in Data.Time.Calendar.Week Methods (==) :: DayOfWeek -> DayOfWeek -> Bool Source # (/=) :: DayOfWeek -> DayOfWeek -> Bool Source #
Ord DayOfWeek |

Instance details

Defined in Data.Time.Calendar.Week

Methods

compare :: DayOfWeek -> DayOfWeek -> Ordering Source #

(<) :: DayOfWeek -> DayOfWeek -> Bool Source #

(<=) :: DayOfWeek -> DayOfWeek -> Bool Source #

(>) :: DayOfWeek -> DayOfWeek -> Bool Source #

(>=) :: DayOfWeek -> DayOfWeek -> Bool Source #

max :: DayOfWeek -> DayOfWeek -> DayOfWeek Source #

min :: DayOfWeek -> DayOfWeek -> DayOfWeek Source #

data DiffTime Source #

This is a length of time, as measured by a clock. Conversion functions such as `fromInteger` and `realToFrac` will treat it as seconds. For example, `(0.010 :: DiffTime)` corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

#### Instances

Instances details

Data DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DiffTime -> c DiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime Source #

toConstr :: DiffTime -> Constr Source #

dataTypeOf :: DiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime Source #

Enum DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

succ :: DiffTime -> DiffTime Source #

pred :: DiffTime -> DiffTime Source #

toEnum :: Int -> DiffTime Source #

fromEnum :: DiffTime -> Int Source #

enumFrom :: DiffTime -> [DiffTime] Source #

enumFromThen :: DiffTime -> DiffTime -> [DiffTime] Source #

enumFromTo :: DiffTime -> DiffTime -> [DiffTime] Source #

enumFromThenTo :: DiffTime -> DiffTime -> DiffTime -> [DiffTime] Source #

Num DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (+) :: DiffTime -> DiffTime -> DiffTime Source # (-) :: DiffTime -> DiffTime -> DiffTime Source # (*) :: DiffTime -> DiffTime -> DiffTime Source # negate :: DiffTime -> DiffTime Source # abs :: DiffTime -> DiffTime Source # signum :: DiffTime -> DiffTime Source # fromInteger :: Integer -> DiffTime Source #
Read DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods readsPrec :: Int -> ReadS DiffTime Source # readList :: ReadS [DiffTime] Source # readPrec :: ReadPrec DiffTime Source # readListPrec :: ReadPrec [DiffTime] Source #
Fractional DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (/) :: DiffTime -> DiffTime -> DiffTime Source # recip :: DiffTime -> DiffTime Source # fromRational :: Rational -> DiffTime Source #
Real DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods toRational :: DiffTime -> Rational Source #
RealFrac DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods properFraction :: Integral b => DiffTime -> (b, DiffTime) Source # truncate :: Integral b => DiffTime -> b Source # round :: Integral b => DiffTime -> b Source # ceiling :: Integral b => DiffTime -> b Source # floor :: Integral b => DiffTime -> b Source #
Show DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods showsPrec :: Int -> DiffTime -> ShowS Source # show :: DiffTime -> String Source # showList :: [DiffTime] -> ShowS Source #
NFData DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods rnf :: DiffTime -> () Source #
Eq DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (==) :: DiffTime -> DiffTime -> Bool Source # (/=) :: DiffTime -> DiffTime -> Bool Source #
Ord DiffTime |

Instance details

Defined in Data.Time.Clock.Internal.DiffTime

Methods

compare :: DiffTime -> DiffTime -> Ordering Source #

(<) :: DiffTime -> DiffTime -> Bool Source #

(<=) :: DiffTime -> DiffTime -> Bool Source #

(>) :: DiffTime -> DiffTime -> Bool Source #

(>=) :: DiffTime -> DiffTime -> Bool Source #

max :: DiffTime -> DiffTime -> DiffTime Source #

min :: DiffTime -> DiffTime -> DiffTime Source #

data NominalDiffTime Source #

This is a length of time, as measured by UTC. It has a precision of 10^-12 s.

Conversion functions such as `fromInteger` and `realToFrac` will treat it as seconds. For example, `(0.010 :: NominalDiffTime)` corresponds to 10 milliseconds.

It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.

It ignores leap-seconds, so it's not necessarily a fixed amount of clock time. For instance, 23:00 UTC + 2 hours of NominalDiffTime = 01:00 UTC (+ 1 day), regardless of whether a leap-second intervened.

#### Instances

Instances details

Data NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NominalDiffTime -> c NominalDiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime Source #

toConstr :: NominalDiffTime -> Constr Source #

dataTypeOf :: NominalDiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime Source #

Enum NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

succ :: NominalDiffTime -> NominalDiffTime Source #

pred :: NominalDiffTime -> NominalDiffTime Source #

toEnum :: Int -> NominalDiffTime Source #

fromEnum :: NominalDiffTime -> Int Source #

enumFrom :: NominalDiffTime -> [NominalDiffTime] Source #

enumFromThen :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

enumFromTo :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

enumFromThenTo :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] Source #

Num NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

(+) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

(-) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

(*) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

negate :: NominalDiffTime -> NominalDiffTime Source #

abs :: NominalDiffTime -> NominalDiffTime Source #

signum :: NominalDiffTime -> NominalDiffTime Source #

fromInteger :: Integer -> NominalDiffTime Source #

Read NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods readsPrec :: Int -> ReadS NominalDiffTime Source # readList :: ReadS [NominalDiffTime] Source # readPrec :: ReadPrec NominalDiffTime Source # readListPrec :: ReadPrec [NominalDiffTime] Source #
Fractional NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (/) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source # recip :: NominalDiffTime -> NominalDiffTime Source # fromRational :: Rational -> NominalDiffTime Source #
Real NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods toRational :: NominalDiffTime -> Rational Source #
RealFrac NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods properFraction :: Integral b => NominalDiffTime -> (b, NominalDiffTime) Source # truncate :: Integral b => NominalDiffTime -> b Source # round :: Integral b => NominalDiffTime -> b Source # ceiling :: Integral b => NominalDiffTime -> b Source # floor :: Integral b => NominalDiffTime -> b Source #
Show NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods showsPrec :: Int -> NominalDiffTime -> ShowS Source # show :: NominalDiffTime -> String Source # showList :: [NominalDiffTime] -> ShowS Source #
NFData NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods rnf :: NominalDiffTime -> () Source #
Eq NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (==) :: NominalDiffTime -> NominalDiffTime -> Bool Source # (/=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #
Ord NominalDiffTime |

Instance details

Defined in Data.Time.Clock.Internal.NominalDiffTime

Methods

compare :: NominalDiffTime -> NominalDiffTime -> Ordering Source #

(<) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(<=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

(>=) :: NominalDiffTime -> NominalDiffTime -> Bool Source #

max :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

min :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime Source #

data UTCTime Source #

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Constructors

UTCTime |

Fields

- utctDay :: Day

  the day

- utctDayTime :: DiffTime

  the time from midnight, 0 <= t < 86401s (because of leap-seconds)

#### Instances

Instances details

Data UTCTime |

Instance details

Defined in Data.Time.Clock.Internal.UTCTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UTCTime -> c UTCTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime Source #

toConstr :: UTCTime -> Constr Source #

dataTypeOf :: UTCTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime) Source #

gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime Source #

NFData UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods rnf :: UTCTime -> () Source #
Eq UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods (==) :: UTCTime -> UTCTime -> Bool Source # (/=) :: UTCTime -> UTCTime -> Bool Source #
Ord UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods compare :: UTCTime -> UTCTime -> Ordering Source # (<) :: UTCTime -> UTCTime -> Bool Source # (<=) :: UTCTime -> UTCTime -> Bool Source # (>) :: UTCTime -> UTCTime -> Bool Source # (>=) :: UTCTime -> UTCTime -> Bool Source # max :: UTCTime -> UTCTime -> UTCTime Source # min :: UTCTime -> UTCTime -> UTCTime Source #

newtype UniversalTime Source #

The Modified Julian Date is the day with the fraction of the day, measured from UT midnight. It's used to represent UT1, which is time as measured by the earth's rotation, adjusted for various wobbles.

Constructors

ModJulianDate |

Fields

- getModJulianDate :: Rational

#### Instances

Instances details

Data UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UniversalTime -> c UniversalTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UniversalTime Source #

toConstr :: UniversalTime -> Constr Source #

dataTypeOf :: UniversalTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UniversalTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UniversalTime) Source #

gmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> UniversalTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UniversalTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime Source #

NFData UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods rnf :: UniversalTime -> () Source #
Eq UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods (==) :: UniversalTime -> UniversalTime -> Bool Source # (/=) :: UniversalTime -> UniversalTime -> Bool Source #
Ord UniversalTime |

Instance details

Defined in Data.Time.Clock.Internal.UniversalTime

Methods

compare :: UniversalTime -> UniversalTime -> Ordering Source #

(<) :: UniversalTime -> UniversalTime -> Bool Source #

(<=) :: UniversalTime -> UniversalTime -> Bool Source #

(>) :: UniversalTime -> UniversalTime -> Bool Source #

(>=) :: UniversalTime -> UniversalTime -> Bool Source #

max :: UniversalTime -> UniversalTime -> UniversalTime Source #

min :: UniversalTime -> UniversalTime -> UniversalTime Source #

data CalendarDiffTime Source #

Constructors

CalendarDiffTime |

Fields

- ctMonths :: Integer
- ctTime :: NominalDiffTime

#### Instances

Instances details

Data CalendarDiffTime | Since: time-1.9.2

Instance details

Defined in Data.Time.LocalTime.Internal.CalendarDiffTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CalendarDiffTime -> c CalendarDiffTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CalendarDiffTime Source #

toConstr :: CalendarDiffTime -> Constr Source #

dataTypeOf :: CalendarDiffTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CalendarDiffTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CalendarDiffTime) Source #

gmapT :: (forall b. Data b => b -> b) -> CalendarDiffTime -> CalendarDiffTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CalendarDiffTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> CalendarDiffTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CalendarDiffTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CalendarDiffTime -> m CalendarDiffTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffTime -> m CalendarDiffTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CalendarDiffTime -> m CalendarDiffTime Source #

Monoid CalendarDiffTime | Additive
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods mempty :: CalendarDiffTime Source # mappend :: CalendarDiffTime -> CalendarDiffTime -> CalendarDiffTime Source # mconcat :: [CalendarDiffTime] -> CalendarDiffTime Source #
Semigroup CalendarDiffTime | Additive
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods (<>) :: CalendarDiffTime -> CalendarDiffTime -> CalendarDiffTime Source # sconcat :: NonEmpty CalendarDiffTime -> CalendarDiffTime Source # stimes :: Integral b => b -> CalendarDiffTime -> CalendarDiffTime Source #
Show CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods showsPrec :: Int -> CalendarDiffTime -> ShowS Source # show :: CalendarDiffTime -> String Source # showList :: [CalendarDiffTime] -> ShowS Source #
NFData CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods rnf :: CalendarDiffTime -> () Source #
Eq CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods (==) :: CalendarDiffTime -> CalendarDiffTime -> Bool Source # (/=) :: CalendarDiffTime -> CalendarDiffTime -> Bool Source #

data TimeZone Source #

A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.

Constructors

TimeZone |

Fields

- timeZoneMinutes :: Int

  The number of minutes offset from UTC. Positive means local time will be later in the day than UTC.

- timeZoneSummerOnly :: Bool

  Is this time zone just persisting for the summer?

- timeZoneName :: String

  The name of the zone, typically a three- or four-letter acronym.

#### Instances

Instances details

Data TimeZone |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeZone

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeZone -> c TimeZone Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TimeZone Source #

toConstr :: TimeZone -> Constr Source #

dataTypeOf :: TimeZone -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TimeZone) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TimeZone) Source #

gmapT :: (forall b. Data b => b -> b) -> TimeZone -> TimeZone Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeZone -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeZone -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TimeZone -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeZone -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeZone -> m TimeZone Source #

Show TimeZone | This only shows the time zone name, or offset if the name is empty.
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods showsPrec :: Int -> TimeZone -> ShowS Source # show :: TimeZone -> String Source # showList :: [TimeZone] -> ShowS Source #
NFData TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods rnf :: TimeZone -> () Source #
Eq TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods (==) :: TimeZone -> TimeZone -> Bool Source # (/=) :: TimeZone -> TimeZone -> Bool Source #
Ord TimeZone |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeZone

Methods

compare :: TimeZone -> TimeZone -> Ordering Source #

(<) :: TimeZone -> TimeZone -> Bool Source #

(<=) :: TimeZone -> TimeZone -> Bool Source #

(>) :: TimeZone -> TimeZone -> Bool Source #

(>=) :: TimeZone -> TimeZone -> Bool Source #

max :: TimeZone -> TimeZone -> TimeZone Source #

min :: TimeZone -> TimeZone -> TimeZone Source #

data TimeOfDay Source #

Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.

`TimeOfDay 24 0 0` is considered invalid for the purposes of `makeTimeOfDayValid`, as well as reading and parsing, but valid for ISO 8601 parsing in Data.Time.Format.ISO8601.

Constructors

TimeOfDay |

Fields

- todHour :: Int

  range 0 - 23

- todMin :: Int

  range 0 - 59

- todSec :: Pico

  Note that 0 <= `todSec` < 61, accomodating leap seconds. Any local minute may have a leap second, since leap seconds happen in all zones simultaneously

#### Instances

Instances details

Data TimeOfDay |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeOfDay

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TimeOfDay -> c TimeOfDay Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TimeOfDay Source #

toConstr :: TimeOfDay -> Constr Source #

dataTypeOf :: TimeOfDay -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TimeOfDay) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TimeOfDay) Source #

gmapT :: (forall b. Data b => b -> b) -> TimeOfDay -> TimeOfDay Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TimeOfDay -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TimeOfDay -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> TimeOfDay -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TimeOfDay -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TimeOfDay -> m TimeOfDay Source #

Show TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods showsPrec :: Int -> TimeOfDay -> ShowS Source # show :: TimeOfDay -> String Source # showList :: [TimeOfDay] -> ShowS Source #
NFData TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods rnf :: TimeOfDay -> () Source #
Eq TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods (==) :: TimeOfDay -> TimeOfDay -> Bool Source # (/=) :: TimeOfDay -> TimeOfDay -> Bool Source #
Ord TimeOfDay |

Instance details

Defined in Data.Time.LocalTime.Internal.TimeOfDay

Methods

compare :: TimeOfDay -> TimeOfDay -> Ordering Source #

(<) :: TimeOfDay -> TimeOfDay -> Bool Source #

(<=) :: TimeOfDay -> TimeOfDay -> Bool Source #

(>) :: TimeOfDay -> TimeOfDay -> Bool Source #

(>=) :: TimeOfDay -> TimeOfDay -> Bool Source #

max :: TimeOfDay -> TimeOfDay -> TimeOfDay Source #

min :: TimeOfDay -> TimeOfDay -> TimeOfDay Source #

data LocalTime Source #

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

- localDay :: Day
- localTimeOfDay :: TimeOfDay

#### Instances

Instances details

Data LocalTime |

Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LocalTime -> c LocalTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LocalTime Source #

toConstr :: LocalTime -> Constr Source #

dataTypeOf :: LocalTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LocalTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LocalTime) Source #

gmapT :: (forall b. Data b => b -> b) -> LocalTime -> LocalTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LocalTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LocalTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> LocalTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LocalTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LocalTime -> m LocalTime Source #

Show LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods showsPrec :: Int -> LocalTime -> ShowS Source # show :: LocalTime -> String Source # showList :: [LocalTime] -> ShowS Source #
NFData LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods rnf :: LocalTime -> () Source #
Eq LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods (==) :: LocalTime -> LocalTime -> Bool Source # (/=) :: LocalTime -> LocalTime -> Bool Source #
Ord LocalTime |

Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Methods

compare :: LocalTime -> LocalTime -> Ordering Source #

(<) :: LocalTime -> LocalTime -> Bool Source #

(<=) :: LocalTime -> LocalTime -> Bool Source #

(>) :: LocalTime -> LocalTime -> Bool Source #

(>=) :: LocalTime -> LocalTime -> Bool Source #

max :: LocalTime -> LocalTime -> LocalTime Source #

min :: LocalTime -> LocalTime -> LocalTime Source #

data TimeLocale Source #

Constructors

TimeLocale |

Fields

- wDays :: [(String, String)]

  full and abbreviated week days, starting with Sunday

- months :: [(String, String)]

  full and abbreviated months

- amPm :: (String, String)

  AM/PM symbols

- dateTimeFmt :: String

  formatting strings

- dateFmt :: String

  formatting strings

- timeFmt :: String

  formatting strings

- time12Fmt :: String

  formatting strings

- knownTimeZones :: [TimeZone]

  time zones known by name

#### Instances

Instances details

Show TimeLocale |
Instance details Defined in Data.Time.Format.Locale Methods showsPrec :: Int -> TimeLocale -> ShowS Source # show :: TimeLocale -> String Source # showList :: [TimeLocale] -> ShowS Source #
Eq TimeLocale |
Instance details Defined in Data.Time.Format.Locale Methods (==) :: TimeLocale -> TimeLocale -> Bool Source # (/=) :: TimeLocale -> TimeLocale -> Bool Source #
Ord TimeLocale |

Instance details

Defined in Data.Time.Format.Locale

Methods

compare :: TimeLocale -> TimeLocale -> Ordering Source #

(<) :: TimeLocale -> TimeLocale -> Bool Source #

(<=) :: TimeLocale -> TimeLocale -> Bool Source #

(>) :: TimeLocale -> TimeLocale -> Bool Source #

(>=) :: TimeLocale -> TimeLocale -> Bool Source #

max :: TimeLocale -> TimeLocale -> TimeLocale Source #

min :: TimeLocale -> TimeLocale -> TimeLocale Source #

class ParseTime t Source #

The class of types which can be parsed given a UNIX-style time format string.

Minimal complete definition

parseTimeSpecifier, buildTime

class FormatTime t Source #

Minimal complete definition

formatCharacter

data ZonedTime Source #

A local time together with a time zone.

There is no `Eq` instance for `ZonedTime`. If you want to compare local times, use `zonedTimeToLocalTime`. If you want to compare absolute times, use `zonedTimeToUTC`.

Constructors

ZonedTime |

Fields

- zonedTimeToLocalTime :: LocalTime
- zonedTimeZone :: TimeZone

#### Instances

Instances details

Data ZonedTime |

Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ZonedTime -> c ZonedTime Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ZonedTime Source #

toConstr :: ZonedTime -> Constr Source #

dataTypeOf :: ZonedTime -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ZonedTime) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ZonedTime) Source #

gmapT :: (forall b. Data b => b -> b) -> ZonedTime -> ZonedTime Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ZonedTime -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ZonedTime -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ZonedTime -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ZonedTime -> m ZonedTime Source #

Show ZonedTime | For the time zone, this only shows the name, or offset if the name is empty.
Instance details Defined in Data.Time.LocalTime.Internal.ZonedTime Methods showsPrec :: Int -> ZonedTime -> ShowS Source # show :: ZonedTime -> String Source # showList :: [ZonedTime] -> ShowS Source #
NFData ZonedTime |
Instance details Defined in Data.Time.LocalTime.Internal.ZonedTime Methods rnf :: ZonedTime -> () Source #

pattern May :: MonthOfYear Source #

pattern December :: MonthOfYear Source #

The twelve `MonthOfYear` patterns form a `COMPLETE` set.

pattern November :: MonthOfYear Source #

pattern October :: MonthOfYear Source #

pattern September :: MonthOfYear Source #

pattern August :: MonthOfYear Source #

pattern July :: MonthOfYear Source #

pattern June :: MonthOfYear Source #

pattern April :: MonthOfYear Source #

pattern March :: MonthOfYear Source #

pattern February :: MonthOfYear Source #

pattern January :: MonthOfYear Source #

pattern BeforeCommonEra :: Integer -> Year Source #

Also known as Before Christ. Note that Year 1 = 1 CE, and the previous Year 0 = 1 BCE. `CommonEra` and `BeforeCommonEra` form a `COMPLETE` set.

pattern CommonEra :: Integer -> Year Source #

Also known as Anno Domini.

pattern YearMonthDay :: Year -> MonthOfYear -> DayOfMonth -> Day Source #

Bidirectional abstract constructor for the proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.

formatTime :: FormatTime t => TimeLocale -> String -> t -> String Source #

Substitute various time-related information for each %-code in the string, as per `formatCharacter`.

The general form is `%<modifier><width><alternate><specifier>`, where `<modifier>`, `<width>`, and `<alternate>` are optional.

## `<modifier>`

glibc-style modifiers can be used before the specifier (here marked as `z`):

`%-z`
  no padding
`%_z`
  pad with spaces
`%0z`
  pad with zeros
`%^z`
  convert to upper case
`%#z`
  convert to lower case (consistently, unlike glibc)

## `<width>`

Width digits can also be used after any modifiers and before the specifier (here marked as `z`), for example:

`%4z`
  pad to 4 characters (with default padding character)
`%_12z`
  pad with spaces to 12 characters

## `<alternate>`

An optional `E` character indicates an alternate formatting. Currently this only affects `%Z` and `%z`.

`%Ez`
  alternate formatting

## `<specifier>`

For all types (note these three are done by `formatTime`, not by `formatCharacter`):

`%%`
  `%`
`%t`
  tab
`%n`
  newline

### `TimeZone`

For `TimeZone` (and `ZonedTime` and `UTCTime`):

`%z`
  timezone offset in the format `±HHMM`
`%Ez`
  timezone offset in the format `±HH:MM`
`%Z`
  timezone name (or else offset in the format `±HHMM`)
`%EZ`
  timezone name (or else offset in the format `±HH:MM`)

### `LocalTime`

For `LocalTime` (and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%c`
  as `dateTimeFmt` `locale` (e.g. `%a %b %e %H:%M:%S %Z %Y`)

### `TimeOfDay`

For `TimeOfDay` (and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%R`
  same as `%H:%M`
`%T`
  same as `%H:%M:%S`
`%X`
  as `timeFmt` `locale` (e.g. `%H:%M:%S`)
`%r`
  as `time12Fmt` `locale` (e.g. `%I:%M:%S %p`)
`%P`
  day-half of day from (`amPm` `locale`), converted to lowercase, `am`, `pm`
`%p`
  day-half of day from (`amPm` `locale`), `AM`, `PM`
`%H`
  hour of day (24-hour), 0-padded to two chars, `00` - `23`
`%k`
  hour of day (24-hour), space-padded to two chars, `0` - `23`
`%I`
  hour of day-half (12-hour), 0-padded to two chars, `01` - `12`
`%l`
  hour of day-half (12-hour), space-padded to two chars, `1` - `12`
`%M`
  minute of hour, 0-padded to two chars, `00` - `59`
`%S`
  second of minute (without decimal part), 0-padded to two chars, `00` - `60`
`%q`
  picosecond of second, 0-padded to twelve chars, `000000000000` - `999999999999`.
`%Q`
  decimal point and fraction of second, up to 12 second decimals, without trailing zeros. For a whole number of seconds, `%Q` omits the decimal point unless padding is specified.

### `UTCTime` and `ZonedTime`

For `UTCTime` and `ZonedTime`:

`%s`
  number of whole seconds since the Unix epoch. For times before the Unix epoch, this is a negative number. Note that in `%s.%q` and `%s%Q` the decimals are positive, not negative. For example, 0.9 seconds before the Unix epoch is formatted as `-1.1` with `%s%Q`.

### `DayOfWeek`

For `DayOfWeek` (and `Day` and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%u`
  day of week number for Week Date format, `1` (= Monday) - `7` (= Sunday)
`%w`
  day of week number, `0` (= Sunday) - `6` (= Saturday)
`%a`
  day of week, short form (`snd` from `wDays` `locale`), `Sun` - `Sat`
`%A`
  day of week, long form (`fst` from `wDays` `locale`), `Sunday` - `Saturday`

### `Month`

For `Month` (and `Day` and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%Y`
  year, no padding. Note `%0Y` and `%_Y` pad to four chars
`%y`
  year of century, 0-padded to two chars, `00` - `99`
`%C`
  century, no padding. Note `%0C` and `%_C` pad to two chars
`%B`
  month name, long form (`fst` from `months` `locale`), `January` - `December`
`%b`, `%h`
  month name, short form (`snd` from `months` `locale`), `Jan` - `Dec`
`%m`
  month of year, 0-padded to two chars, `01` - `12`

### `Day`

For `Day` (and `LocalTime` and `ZonedTime` and `UTCTime` and `UniversalTime`):

`%D`
  same as `%m/%d/%y`
`%F`
  same as `%Y-%m-%d`
`%x`
  as `dateFmt` `locale` (e.g. `%m/%d/%y`)
`%d`
  day of month, 0-padded to two chars, `01` - `31`
`%e`
  day of month, space-padded to two chars, `1` - `31`
`%j`
  day of year, 0-padded to three chars, `001` - `366`
`%f`
  century for Week Date format, no padding. Note `%0f` and `%_f` pad to two chars
`%V`
  week of year for Week Date format, 0-padded to two chars, `01` - `53`
`%U`
  week of year where weeks start on Sunday (as `sundayStartWeek`), 0-padded to two chars, `00` - `53`
`%W`
  week of year where weeks start on Monday (as `mondayStartWeek`), 0-padded to two chars, `00` - `53`

## Duration types

The specifiers for `DiffTime`, `NominalDiffTime`, `CalendarDiffDays`, and `CalendarDiffTime` are semantically separate from the other types. Specifiers on negative time differences will generally be negative (think `rem` rather than `mod`).

### `NominalDiffTime` and `DiffTime`

Note that a "minute" of `DiffTime` is simply 60 SI seconds, rather than a minute of civil time. Use `NominalDiffTime` to work with civil time, ignoring any leap seconds.

For `NominalDiffTime` and `DiffTime`:

`%w`
  total whole weeks
`%d`
  total whole days
`%D`
  whole days of week
`%h`
  total whole hours
`%H`
  whole hours of day
`%m`
  total whole minutes
`%M`
  whole minutes of hour
`%s`
  total whole seconds
`%Es`
  total seconds, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%Es` omits the decimal point unless padding is specified.
`%0Es`
  total seconds, with decimal point and <width> (default 12) decimal places.
`%S`
  whole seconds of minute
`%ES`
  seconds of minute, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%ES` omits the decimal point unless padding is specified.
`%0ES`
  seconds of minute as two digits, with decimal point and <width> (default 12) decimal places.

### `CalendarDiffDays`

For `CalendarDiffDays` (and `CalendarDiffTime`):

`%y`
  total years
`%b`
  total months
`%B`
  months of year
`%w`
  total weeks, not including months
`%d`
  total days, not including months
`%D`
  days of week

### `CalendarDiffTime`

For `CalendarDiffTime`:

`%h`
  total hours, not including months
`%H`
  hours of day
`%m`
  total minutes, not including months
`%M`
  minutes of hour
`%s`
  total whole seconds, not including months
`%Es`
  total seconds, not including months, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%Es` omits the decimal point unless padding is specified.
`%0Es`
  total seconds, not including months, with decimal point and <width> (default 12) decimal places.
`%S`
  whole seconds of minute
`%ES`
  seconds of minute, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds, `%ES` omits the decimal point unless padding is specified.
`%0ES`
  seconds of minute as two digits, with decimal point and <width> (default 12) decimal places.

fromGregorian :: Year -> MonthOfYear -> DayOfMonth -> Day Source #

Convert from proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.

calendarDay :: CalendarDiffDays Source #

calendarWeek :: CalendarDiffDays Source #

calendarMonth :: CalendarDiffDays Source #

calendarYear :: CalendarDiffDays Source #

scaleCalendarDiffDays :: Integer -> CalendarDiffDays -> CalendarDiffDays Source #

Scale by a factor. Note that `scaleCalendarDiffDays (-1)` will not perfectly invert a duration, due to variable month lengths.

addDays :: Integer -> Day -> Day Source #

diffDays :: Day -> Day -> Integer Source #

periodAllDays :: DayPeriod p => p -> [Day] Source #

A list of all the days in this period.

Since: time-1.12.1

periodLength :: DayPeriod p => p -> Int Source #

The number of days in this period.

Since: time-1.12.1

periodFromDay :: DayPeriod p => Day -> (p, Int) Source #

Get the period this day is in, with the 1-based day number within the period.

    periodFromDay (periodFirstDay p) = (p,1)

Since: time-1.12.1

periodToDay :: DayPeriod p => p -> Int -> Day Source #

Inverse of `periodFromDay`.

Since: time-1.12.1

periodToDayValid :: DayPeriod p => p -> Int -> Maybe Day Source #

Validating inverse of `periodFromDay`.

Since: time-1.12.1

isLeapYear :: Year -> Bool Source #

Is this year a leap year according to the proleptic Gregorian calendar?

toGregorian :: Day -> (Year, MonthOfYear, DayOfMonth) Source #

Convert to proleptic Gregorian calendar.

fromGregorianValid :: Year -> MonthOfYear -> DayOfMonth -> Maybe Day Source #

Convert from proleptic Gregorian calendar. Invalid values will return Nothing

showGregorian :: Day -> String Source #

Show in ISO 8601 format (yyyy-mm-dd)

gregorianMonthLength :: Year -> MonthOfYear -> DayOfMonth Source #

The number of days in a given month according to the proleptic Gregorian calendar.

addGregorianMonthsClip :: Integer -> Day -> Day Source #

Add months, with days past the last day of the month clipped to the last day. For instance, 2005-01-30 + 1 month = 2005-02-28.

addGregorianMonthsRollOver :: Integer -> Day -> Day Source #

Add months, with days past the last day of the month rolling over to the next month. For instance, 2005-01-30 + 1 month = 2005-03-02.

addGregorianYearsClip :: Integer -> Day -> Day Source #

Add years, matching month and day, with Feb 29th clipped to Feb 28th if necessary. For instance, 2004-02-29 + 2 years = 2006-02-28.

addGregorianYearsRollOver :: Integer -> Day -> Day Source #

Add years, matching month and day, with Feb 29th rolled over to Mar 1st if necessary. For instance, 2004-02-29 + 2 years = 2006-03-01.

addGregorianDurationClip :: CalendarDiffDays -> Day -> Day Source #

Add months (clipped to last day), then add days

addGregorianDurationRollOver :: CalendarDiffDays -> Day -> Day Source #

Add months (rolling over to next month), then add days

diffGregorianDurationClip :: Day -> Day -> CalendarDiffDays Source #

Calendrical difference, with as many whole months as possible

diffGregorianDurationRollOver :: Day -> Day -> CalendarDiffDays Source #

Calendrical difference, with as many whole months as possible. Same as `diffGregorianDurationClip` for positive durations.

dayOfWeek :: Day -> DayOfWeek Source #

dayOfWeekDiff :: DayOfWeek -> DayOfWeek -> Int Source #

`dayOfWeekDiff a b = a - b` in range 0 to 6. The number of days from b to the next a.

firstDayOfWeekOnAfter :: DayOfWeek -> Day -> Day Source #

The first day-of-week on or after some day

weekAllDays :: DayOfWeek -> Day -> [Day] Source #

Returns a week containing the given `Day` where the first day is the `DayOfWeek` specified.

Examples:

    >>> weekAllDays Sunday (YearMonthDay 2022 02 21)
    [YearMonthDay 2022 2 20 .. YearMonthDay 2022 2 26]

    >>> weekAllDays Monday (YearMonthDay 2022 02 21)
    [YearMonthDay 2022 2 21 .. YearMonthDay 2022 2 27]

    >>> weekAllDays Tuesday (YearMonthDay 2022 02 21)
    [YearMonthDay 2022 2 15 .. YearMonthDay 2022 2 21]

Since: time-1.12.2

weekFirstDay :: DayOfWeek -> Day -> Day Source #

Returns the first day of a week containing the given `Day`.

Examples:

    >>> weekFirstDay Sunday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 20

    >>> weekFirstDay Monday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 21

    >>> weekFirstDay Tuesday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 15

Since: time-1.12.2

weekLastDay :: DayOfWeek -> Day -> Day Source #

Returns the last day of a week containing the given `Day`.

Examples:

    >>> weekLastDay Sunday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 26

    >>> weekLastDay Monday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 27

    >>> weekLastDay Tuesday (YearMonthDay 2022 02 21)
    YearMonthDay 2022 2 21

Since: time-1.12.2

secondsToDiffTime :: Integer -> DiffTime Source #

Create a `DiffTime` which represents an integral number of seconds.

picosecondsToDiffTime :: Integer -> DiffTime Source #

Create a `DiffTime` from a number of picoseconds.

diffTimeToPicoseconds :: DiffTime -> Integer Source #

Get the number of picoseconds in a `DiffTime`.

secondsToNominalDiffTime :: Pico -> NominalDiffTime Source #

Create a `NominalDiffTime` from a number of seconds.

Since: time-1.9.1

nominalDiffTimeToSeconds :: NominalDiffTime -> Pico Source #

Get the seconds in a `NominalDiffTime`.

Since: time-1.9.1

nominalDay :: NominalDiffTime Source #

One day in `NominalDiffTime`.

getTime_resolution :: DiffTime Source #

The resolution of `getSystemTime`, `getCurrentTime`, `getPOSIXTime`. On UNIX systems this uses `clock_getres`, which may be wrong on WSL2.

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime Source #

addUTCTime a b = a + b

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime Source #

diffUTCTime a b = a - b

calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime Source #

calendarTimeTime :: NominalDiffTime -> CalendarDiffTime Source #

scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime Source #

Scale by a factor. Note that `scaleCalendarDiffTime (-1)` will not perfectly invert a duration, due to variable month lengths.

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.

timeZoneOffsetString' :: Maybe Char -> TimeZone -> String Source #

Text representing the offset of this timezone, such as "-0800" or "+0400" (like `%z` in formatTime), with arbitrary padding.

timeZoneOffsetString :: TimeZone -> String Source #

Text representing the offset of this timezone, such as "-0800" or "+0400" (like `%z` in formatTime).

utc :: TimeZone Source #

The UTC time zone.

midnight :: TimeOfDay Source #

Hour zero

midday :: TimeOfDay Source #

Hour twelve

makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay Source #

timeToDaysAndTimeOfDay :: NominalDiffTime -> (Integer, TimeOfDay) Source #

Convert a period of time into a count of days and a time of day since midnight. The time of day will never have a leap second.

daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime Source #

Convert a count of days and a time of day since midnight into a period of time.

utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay) Source #

Convert a time of day in UTC to a time of day in some timezone, together with a day adjustment.

localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay) Source #

Convert a time of day in some timezone to a time of day in UTC, together with a day adjustment.

timeToTimeOfDay :: DiffTime -> TimeOfDay Source #

Get the time of day given a time since midnight. Time more than 24h will be converted to leap-seconds.

pastMidnight :: DiffTime -> TimeOfDay Source #

Same as `timeToTimeOfDay`.

timeOfDayToTime :: TimeOfDay -> DiffTime Source #

Get the time since midnight for a given time of day.

sinceMidnight :: TimeOfDay -> DiffTime Source #

Same as `timeOfDayToTime`.

dayFractionToTimeOfDay :: Rational -> TimeOfDay Source #

Get the time of day given the fraction of a day since midnight.

timeOfDayToDayFraction :: TimeOfDay -> Rational Source #

Get the fraction of a day since midnight given a time of day.

addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime Source #

addLocalTime a b = a + b

diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime Source #

diffLocalTime a b = a - b

utcToLocalTime :: TimeZone -> UTCTime -> LocalTime Source #

Get the local time of a UTC time in a time zone.

localTimeToUTC :: TimeZone -> LocalTime -> UTCTime Source #

Get the UTC time of a local time in a time zone.

ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime Source #

Get the local time of a UT1 time on a particular meridian (in degrees, positive is East).

localTimeToUT1 :: Rational -> LocalTime -> UniversalTime Source #

Get the UT1 time of a local time on a particular meridian (in degrees, positive is East).

defaultTimeLocale :: TimeLocale Source #

Locale representing American usage.

`knownTimeZones` contains only the ten time-zones mentioned in RFC 822 sec. 5: "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT". Note that the parsing functions will regardless parse "UTC", single-letter military time-zones, and +HHMM format.

iso8601DateFormat :: Maybe String -> String Source #

Construct format string according to ISO-8601.

The `Maybe String` argument allows to supply an optional time specification. E.g.:

    iso8601DateFormat Nothing            == "%Y-%m-%d"           -- i.e. YYYY-MM-DD
    iso8601DateFormat (Just "%H:%M:%S")  == "%Y-%m-%dT%H:%M:%S"  -- i.e. YYYY-MM-DDTHH:MM:SS

rfc822DateFormat :: String Source #

Format string according to RFC822.

utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime Source #

zonedTimeToUTC :: ZonedTime -> UTCTime Source #

parseTimeM Source #

Arguments

:: (MonadFail m, ParseTime t) |
=> Bool | Accept leading and trailing whitespace?
-> TimeLocale | Time locale.
-> String | Format string.
-> String | Input string.
-> m t | Return the time value, or fail if the input could not be parsed using the given format.

Parses a time value given a format string. Missing information will be derived from 1970-01-01 00:00 UTC (which was a Thursday). Supports the same %-codes as `formatTime`, including `%-`, `%_` and `%0` modifiers, however padding widths are not supported. Case is not significant in the input string. Some variations in the input are accepted:

`%z` `%Ez`
  accepts any of `±HHMM` or `±HH:MM`.
`%Z` `%EZ`
  accepts any string of letters, or any of the formats accepted by `%z`.
`%0Y`
  accepts exactly four digits.
`%0G`
  accepts exactly four digits.
`%0C`
  accepts exactly two digits.
`%0f`
  accepts exactly two digits.

For example, to parse a date in YYYY-MM-DD format, while allowing the month and date to have optional leading zeros (notice the `-` modifier used for `%m` and `%d`):

    Prelude Data.Time> parseTimeM True defaultTimeLocale "%Y-%-m-%-d" "2010-3-04" :: Maybe Day
    Just 2010-03-04

parseTimeMultipleM Source #

Arguments

:: (MonadFail m, ParseTime t) |
=> Bool | Accept leading and trailing whitespace?
-> TimeLocale | Time locale.
-> [(String, String)] | Pairs of (format string, input string).
-> m t | Return the time value, or fail if the input could not be parsed using the given format.

Parses a time value given a list of pairs of format and input. Resulting value is constructed from all provided specifiers.

parseTimeOrError Source #

Arguments

:: ParseTime t |
=> Bool | Accept leading and trailing whitespace?
-> TimeLocale | Time locale.
-> String | Format string.
-> String | Input string.
-> t | The time value.

Parse a time value given a format string. Fails if the input could not be parsed using the given format. See `parseTimeM` for details.

readSTime Source #

Arguments

:: ParseTime t |
=> Bool | Accept leading whitespace?
-> TimeLocale | Time locale.
-> String | Format string
-> ReadS t |

Parse a time value given a format string. See `parseTimeM` for details.

readPTime Source #

Arguments

:: ParseTime t |
=> Bool | Accept leading whitespace?
-> TimeLocale | Time locale.
-> String | Format string
-> ReadP t |

Parse a time value given a format string. See `parseTimeM` for details.

getCurrentTime :: MonadIO m => m UTCTime Source #

getTimeZone :: MonadIO m => UTCTime -> m TimeZone Source #

getCurrentTimeZone :: MonadIO m => m TimeZone Source #

getZonedTime :: MonadIO m => m ZonedTime Source #

utcToLocalZonedTime :: MonadIO m => UTCTime -> m ZonedTime Source #