Data.Time.Clock.Compat

time-compat-1.9.6.1: Compatibility package for time

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Time.Clock.Compat

Contents

- Universal Time
- Absolute intervals, DiffTime
- UTCTime
- NominalDiffTime
- UTC differences
- Current time
- Type aliases

Synopsis

- newtype UniversalTime = ModJulianDate {
  - getModJulianDate :: Rational
  }
- data DiffTime
- secondsToDiffTime :: Integer -> DiffTime
- picosecondsToDiffTime :: Integer -> DiffTime
- diffTimeToPicoseconds :: DiffTime -> Integer
- data UTCTime = UTCTime {
  - utctDay :: Day
  - utctDayTime :: DiffTime
  }
- data NominalDiffTime
- secondsToNominalDiffTime :: Pico -> NominalDiffTime
- nominalDiffTimeToSeconds :: NominalDiffTime -> Pico
- nominalDay :: NominalDiffTime
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- getCurrentTime :: IO UTCTime
- getTime_resolution :: DiffTime
- type Year = Integer
- type MonthOfYear = Int
- type DayOfMonth = Int

# Universal Time

Time as measured by the Earth.

newtype UniversalTime #

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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UniversalTime toConstr :: UniversalTime -> Constr dataTypeOf :: UniversalTime -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UniversalTime) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UniversalTime) gmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r gmapQ :: (forall d. Data d => d -> u) -> UniversalTime -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> UniversalTime -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
NFData UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods rnf :: UniversalTime -> ()
Eq UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods (==) :: UniversalTime -> UniversalTime -> Bool (/=) :: UniversalTime -> UniversalTime -> Bool
Ord UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods compare :: UniversalTime -> UniversalTime -> Ordering (<) :: UniversalTime -> UniversalTime -> Bool (<=) :: UniversalTime -> UniversalTime -> Bool (>) :: UniversalTime -> UniversalTime -> Bool (>=) :: UniversalTime -> UniversalTime -> Bool max :: UniversalTime -> UniversalTime -> UniversalTime min :: UniversalTime -> UniversalTime -> UniversalTime
Hashable UniversalTime # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> UniversalTime -> Int # hash :: UniversalTime -> Int #

# Absolute intervals, DiffTime

data DiffTime #

#### 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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DiffTime toConstr :: DiffTime -> Constr dataTypeOf :: DiffTime -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DiffTime) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DiffTime) gmapT :: (forall b. Data b => b -> b) -> DiffTime -> DiffTime gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DiffTime -> r gmapQ :: (forall d. Data d => d -> u) -> DiffTime -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> DiffTime -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DiffTime -> m DiffTime
Enum DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods succ :: DiffTime -> DiffTime pred :: DiffTime -> DiffTime toEnum :: Int -> DiffTime fromEnum :: DiffTime -> Int enumFrom :: DiffTime -> [DiffTime] enumFromThen :: DiffTime -> DiffTime -> [DiffTime] enumFromTo :: DiffTime -> DiffTime -> [DiffTime] enumFromThenTo :: DiffTime -> DiffTime -> DiffTime -> [DiffTime]
Num DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (+) :: DiffTime -> DiffTime -> DiffTime (-) :: DiffTime -> DiffTime -> DiffTime (*) :: DiffTime -> DiffTime -> DiffTime negate :: DiffTime -> DiffTime abs :: DiffTime -> DiffTime signum :: DiffTime -> DiffTime fromInteger :: Integer -> DiffTime
Read DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods readsPrec :: Int -> ReadS DiffTime readList :: ReadS [DiffTime] readPrec :: ReadPrec DiffTime readListPrec :: ReadPrec [DiffTime]
Fractional DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (/) :: DiffTime -> DiffTime -> DiffTime recip :: DiffTime -> DiffTime fromRational :: Rational -> DiffTime
Real DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods toRational :: DiffTime -> Rational
RealFrac DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods properFraction :: Integral b => DiffTime -> (b, DiffTime) truncate :: Integral b => DiffTime -> b round :: Integral b => DiffTime -> b ceiling :: Integral b => DiffTime -> b floor :: Integral b => DiffTime -> b
Show DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods showsPrec :: Int -> DiffTime -> ShowS show :: DiffTime -> String showList :: [DiffTime] -> ShowS
NFData DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods rnf :: DiffTime -> ()
Eq DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods (==) :: DiffTime -> DiffTime -> Bool (/=) :: DiffTime -> DiffTime -> Bool
Ord DiffTime |
Instance details Defined in Data.Time.Clock.Internal.DiffTime Methods compare :: DiffTime -> DiffTime -> Ordering (<) :: DiffTime -> DiffTime -> Bool (<=) :: DiffTime -> DiffTime -> Bool (>) :: DiffTime -> DiffTime -> Bool (>=) :: DiffTime -> DiffTime -> Bool max :: DiffTime -> DiffTime -> DiffTime min :: DiffTime -> DiffTime -> DiffTime
Hashable DiffTime # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> DiffTime -> Int # hash :: DiffTime -> Int #

secondsToDiffTime :: Integer -> DiffTime #

picosecondsToDiffTime :: Integer -> DiffTime #

diffTimeToPicoseconds :: DiffTime -> Integer #

# UTCTime

data UTCTime #

Constructors

UTCTime |
Fields utctDay :: Day utctDayTime :: DiffTime

#### 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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UTCTime toConstr :: UTCTime -> Constr dataTypeOf :: UTCTime -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UTCTime) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime) gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UTCTime -> r gmapQ :: (forall d. Data d => d -> u) -> UTCTime -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> UTCTime -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
NFData UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods rnf :: UTCTime -> ()
Eq UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods (==) :: UTCTime -> UTCTime -> Bool (/=) :: UTCTime -> UTCTime -> Bool
Ord UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods compare :: UTCTime -> UTCTime -> Ordering (<) :: UTCTime -> UTCTime -> Bool (<=) :: UTCTime -> UTCTime -> Bool (>) :: UTCTime -> UTCTime -> Bool (>=) :: UTCTime -> UTCTime -> Bool max :: UTCTime -> UTCTime -> UTCTime min :: UTCTime -> UTCTime -> UTCTime
Hashable UTCTime # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> UTCTime -> Int # hash :: UTCTime -> Int #
ISO8601 UTCTime |
Instance details Defined in Data.Time.Format.ISO8601 Methods iso8601Format :: Format UTCTime #

# NominalDiffTime

data NominalDiffTime #

#### 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 gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NominalDiffTime toConstr :: NominalDiffTime -> Constr dataTypeOf :: NominalDiffTime -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NominalDiffTime) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NominalDiffTime) gmapT :: (forall b. Data b => b -> b) -> NominalDiffTime -> NominalDiffTime gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NominalDiffTime -> r gmapQ :: (forall d. Data d => d -> u) -> NominalDiffTime -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> NominalDiffTime -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NominalDiffTime -> m NominalDiffTime
Enum NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods succ :: NominalDiffTime -> NominalDiffTime pred :: NominalDiffTime -> NominalDiffTime toEnum :: Int -> NominalDiffTime fromEnum :: NominalDiffTime -> Int enumFrom :: NominalDiffTime -> [NominalDiffTime] enumFromThen :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] enumFromTo :: NominalDiffTime -> NominalDiffTime -> [NominalDiffTime] enumFromThenTo :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime -> [NominalDiffTime]
Num NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (+) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime (-) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime (*) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime negate :: NominalDiffTime -> NominalDiffTime abs :: NominalDiffTime -> NominalDiffTime signum :: NominalDiffTime -> NominalDiffTime fromInteger :: Integer -> NominalDiffTime
Read NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods readsPrec :: Int -> ReadS NominalDiffTime readList :: ReadS [NominalDiffTime] readPrec :: ReadPrec NominalDiffTime readListPrec :: ReadPrec [NominalDiffTime]
Fractional NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (/) :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime recip :: NominalDiffTime -> NominalDiffTime fromRational :: Rational -> NominalDiffTime
Real NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods toRational :: NominalDiffTime -> Rational
RealFrac NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods properFraction :: Integral b => NominalDiffTime -> (b, NominalDiffTime) truncate :: Integral b => NominalDiffTime -> b round :: Integral b => NominalDiffTime -> b ceiling :: Integral b => NominalDiffTime -> b floor :: Integral b => NominalDiffTime -> b
Show NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods showsPrec :: Int -> NominalDiffTime -> ShowS show :: NominalDiffTime -> String showList :: [NominalDiffTime] -> ShowS
NFData NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods rnf :: NominalDiffTime -> ()
Eq NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods (==) :: NominalDiffTime -> NominalDiffTime -> Bool (/=) :: NominalDiffTime -> NominalDiffTime -> Bool
Ord NominalDiffTime |
Instance details Defined in Data.Time.Clock.Internal.NominalDiffTime Methods compare :: NominalDiffTime -> NominalDiffTime -> Ordering (<) :: NominalDiffTime -> NominalDiffTime -> Bool (<=) :: NominalDiffTime -> NominalDiffTime -> Bool (>) :: NominalDiffTime -> NominalDiffTime -> Bool (>=) :: NominalDiffTime -> NominalDiffTime -> Bool max :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime min :: NominalDiffTime -> NominalDiffTime -> NominalDiffTime
Hashable NominalDiffTime # |
Instance details Defined in Data.Time.Orphans Methods hashWithSalt :: Int -> NominalDiffTime -> Int # hash :: NominalDiffTime -> Int #

secondsToNominalDiffTime :: Pico -> NominalDiffTime #

nominalDiffTimeToSeconds :: NominalDiffTime -> Pico #

nominalDay :: NominalDiffTime #

# UTC differences

addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime #

diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime #

# Current time

getCurrentTime :: IO UTCTime #

getTime_resolution :: DiffTime #

# Type aliases

type Year = Integer #

type MonthOfYear = Int #

type DayOfMonth = Int #