time-compat-1.9.3: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.LocalTime.Compat

Contents

- Time zones
- Time of day
- CalendarDiffTime
- Local Time
- Zoned Time

Synopsis

- data TimeZone = TimeZone {
  - timeZoneMinutes :: Int
  - timeZoneSummerOnly :: Bool
  - timeZoneName :: String
  }
- timeZoneOffsetString :: TimeZone -> String
- timeZoneOffsetString' :: Maybe Char -> TimeZone -> String
- minutesToTimeZone :: Int -> TimeZone
- hoursToTimeZone :: Int -> TimeZone
- utc :: TimeZone
- getTimeZone :: UTCTime -> IO TimeZone
- getCurrentTimeZone :: IO TimeZone
- data TimeOfDay = TimeOfDay {
  - todHour :: Int
  - todMin :: Int
  - todSec :: Pico
  }
- 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
- timeOfDayToTime :: TimeOfDay -> DiffTime
- dayFractionToTimeOfDay :: Rational -> TimeOfDay
- timeOfDayToDayFraction :: TimeOfDay -> Rational
- pastMidnight :: DiffTime -> TimeOfDay
- sinceMidnight :: TimeOfDay -> DiffTime
- data CalendarDiffTime = CalendarDiffTime {
  - ctMonths :: Integer
  - ctTime :: NominalDiffTime
  }
- calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime
- calendarTimeTime :: NominalDiffTime -> CalendarDiffTime
- scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime
- data LocalTime = LocalTime {
  - localDay :: Day
  - localTimeOfDay :: TimeOfDay
  }
- addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime
- diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime
- utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
- localTimeToUTC :: TimeZone -> LocalTime -> UTCTime
- ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime
- localTimeToUT1 :: Rational -> LocalTime -> UniversalTime
- data ZonedTime = ZonedTime {
  - zonedTimeToLocalTime :: LocalTime
  - zonedTimeZone :: TimeZone
  }
- utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
- zonedTimeToUTC :: ZonedTime -> UTCTime
- getZonedTime :: IO ZonedTime
- utcToLocalZonedTime :: UTCTime -> IO ZonedTime

# Time zones

data TimeZone #

Constructors

TimeZone |

Fields

- timeZoneMinutes :: Int
- timeZoneSummerOnly :: Bool
- timeZoneName :: String

#### Instances

Instances details

Eq TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods (==) :: TimeZone -> TimeZone -> Bool (/=) :: TimeZone -> TimeZone -> Bool
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

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

toConstr :: TimeZone -> Constr

dataTypeOf :: TimeZone -> DataType

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

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

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

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

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

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

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

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

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

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

Ord TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods compare :: TimeZone -> TimeZone -> Ordering (<) :: TimeZone -> TimeZone -> Bool (<=) :: TimeZone -> TimeZone -> Bool (>) :: TimeZone -> TimeZone -> Bool (>=) :: TimeZone -> TimeZone -> Bool max :: TimeZone -> TimeZone -> TimeZone min :: TimeZone -> TimeZone -> TimeZone
Show TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods showsPrec :: Int -> TimeZone -> ShowS show :: TimeZone -> String showList :: [TimeZone] -> ShowS
NFData TimeZone |
Instance details Defined in Data.Time.LocalTime.Internal.TimeZone Methods rnf :: TimeZone -> ()
ISO8601 TimeZone |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format TimeZone #

timeZoneOffsetString :: TimeZone -> String #

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

minutesToTimeZone :: Int -> TimeZone #

hoursToTimeZone :: Int -> TimeZone #

utc :: TimeZone #

getTimeZone :: UTCTime -> IO TimeZone #

getCurrentTimeZone :: IO TimeZone #

# Time of day

data TimeOfDay #

Constructors

TimeOfDay |

Fields

- todHour :: Int
- todMin :: Int
- todSec :: Pico

#### Instances

Instances details

Eq TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods (==) :: TimeOfDay -> TimeOfDay -> Bool (/=) :: TimeOfDay -> TimeOfDay -> Bool
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

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

toConstr :: TimeOfDay -> Constr

dataTypeOf :: TimeOfDay -> DataType

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

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

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

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

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

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

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

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

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

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

Ord TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods compare :: TimeOfDay -> TimeOfDay -> Ordering (<) :: TimeOfDay -> TimeOfDay -> Bool (<=) :: TimeOfDay -> TimeOfDay -> Bool (>) :: TimeOfDay -> TimeOfDay -> Bool (>=) :: TimeOfDay -> TimeOfDay -> Bool max :: TimeOfDay -> TimeOfDay -> TimeOfDay min :: TimeOfDay -> TimeOfDay -> TimeOfDay
Show TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods showsPrec :: Int -> TimeOfDay -> ShowS show :: TimeOfDay -> String showList :: [TimeOfDay] -> ShowS
NFData TimeOfDay |
Instance details Defined in Data.Time.LocalTime.Internal.TimeOfDay Methods rnf :: TimeOfDay -> ()
ISO8601 TimeOfDay |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format TimeOfDay #

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 #

timeOfDayToTime :: TimeOfDay -> DiffTime #

dayFractionToTimeOfDay :: Rational -> TimeOfDay #

timeOfDayToDayFraction :: TimeOfDay -> Rational #

pastMidnight :: DiffTime -> TimeOfDay Source #

Same as `timeToTimeOfDay`.

sinceMidnight :: TimeOfDay -> DiffTime Source #

Same as `timeOfDayToTime`.

# CalendarDiffTime

data CalendarDiffTime #

Constructors

CalendarDiffTime |

Fields

- ctMonths :: Integer
- ctTime :: NominalDiffTime

#### Instances

Instances details

Eq CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods (==) :: CalendarDiffTime -> CalendarDiffTime -> Bool (/=) :: CalendarDiffTime -> CalendarDiffTime -> Bool
Data CalendarDiffTime |

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

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

toConstr :: CalendarDiffTime -> Constr

dataTypeOf :: CalendarDiffTime -> DataType

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

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

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

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

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

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

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

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

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

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

Show CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods showsPrec :: Int -> CalendarDiffTime -> ShowS show :: CalendarDiffTime -> String showList :: [CalendarDiffTime] -> ShowS
Semigroup CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods (<>) :: CalendarDiffTime -> CalendarDiffTime -> CalendarDiffTime sconcat :: NonEmpty CalendarDiffTime -> CalendarDiffTime stimes :: Integral b => b -> CalendarDiffTime -> CalendarDiffTime
Monoid CalendarDiffTime |
Instance details Defined in Data.Time.LocalTime.Internal.CalendarDiffTime Methods mempty :: CalendarDiffTime mappend :: CalendarDiffTime -> CalendarDiffTime -> CalendarDiffTime mconcat :: [CalendarDiffTime] -> CalendarDiffTime
ISO8601 CalendarDiffTime |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format CalendarDiffTime #

calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime #

calendarTimeTime :: NominalDiffTime -> CalendarDiffTime #

scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime #

# Local Time

data LocalTime #

Constructors

LocalTime |

Fields

- localDay :: Day
- localTimeOfDay :: TimeOfDay

#### Instances

Instances details

Eq LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods (==) :: LocalTime -> LocalTime -> Bool (/=) :: LocalTime -> LocalTime -> Bool
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

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

toConstr :: LocalTime -> Constr

dataTypeOf :: LocalTime -> DataType

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

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

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

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

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

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

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

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

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

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

Ord LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods compare :: LocalTime -> LocalTime -> Ordering (<) :: LocalTime -> LocalTime -> Bool (<=) :: LocalTime -> LocalTime -> Bool (>) :: LocalTime -> LocalTime -> Bool (>=) :: LocalTime -> LocalTime -> Bool max :: LocalTime -> LocalTime -> LocalTime min :: LocalTime -> LocalTime -> LocalTime
Show LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods showsPrec :: Int -> LocalTime -> ShowS show :: LocalTime -> String showList :: [LocalTime] -> ShowS
NFData LocalTime |
Instance details Defined in Data.Time.LocalTime.Internal.LocalTime Methods rnf :: LocalTime -> ()
ISO8601 LocalTime |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format LocalTime #

addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime #

diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime #

utcToLocalTime :: TimeZone -> UTCTime -> LocalTime #

localTimeToUTC :: TimeZone -> LocalTime -> UTCTime #

ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime #

localTimeToUT1 :: Rational -> LocalTime -> UniversalTime #

# Zoned Time

data ZonedTime #

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

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

toConstr :: ZonedTime -> Constr

dataTypeOf :: ZonedTime -> DataType

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

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

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

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

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

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

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

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

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

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

Show ZonedTime |
Instance details Defined in Data.Time.LocalTime.Internal.ZonedTime Methods showsPrec :: Int -> ZonedTime -> ShowS show :: ZonedTime -> String showList :: [ZonedTime] -> ShowS
NFData ZonedTime |
Instance details Defined in Data.Time.LocalTime.Internal.ZonedTime Methods rnf :: ZonedTime -> ()
ISO8601 ZonedTime |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format ZonedTime #

utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime #

zonedTimeToUTC :: ZonedTime -> UTCTime #

getZonedTime :: IO ZonedTime #

utcToLocalZonedTime :: UTCTime -> IO ZonedTime #