| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Time.Hora.Part
Contents
Description
convert between UTCTime, UTCTimeBin, DatePart, DatePartSmall
Synopsis
- class FromUTC a where
- fromUtc' :: (Tz' tz, Integral a) => tz -> UTCTime -> Tz (DatePart a)
- class ToUTC a where
- mkDay :: Integral a => a -> a -> a -> DatePartSmall
- mkMin :: (Num a, Integral a) => a -> a -> DatePartSmall
- mkMs :: (Num a, Integral a) => a -> a -> DatePartSmall
- normalize :: DatePartSmall -> DatePartSmall
- julian_day_offset :: Integral a => a
FromUTC
class FromUTC a where Source #
Minimal complete definition
Instances
| FromUTC DatePartSmall Source # | |
Defined in Data.Time.Hora.Part Methods fromUtc :: UTCTime -> DatePartSmall Source # | |
| FromUTC UTCTimeBin Source # | |
Defined in Data.Time.Hora.Part Methods fromUtc :: UTCTime -> UTCTimeBin Source # | |
| Integral a => FromUTC (DatePart a) Source # | returns DatePart a in UTC timezone |
ToUTC
Minimal complete definition
DatePartSmall
Arguments
| :: (Num a, Integral a) | |
| => a | hour |
| -> a | minute |
| -> DatePartSmall |
minutes including hours
Arguments
| :: (Num a, Integral a) | |
| => a | second |
| -> a | millisecond |
| -> DatePartSmall |
milliseconds including seconds
normalize :: DatePartSmall -> DatePartSmall Source #
for (Time, DatePartSmall) increase:
minutes if seconds > 60
days if minutes > 24 * 60
! does not change the constructor. Time remains Time
this function is called by toUtc before the conversion
julian_day_offset :: Integral a => a Source #
Julian day offset
https://en.wikipedia.org/wiki/Julian_day
>>>mkDay 1 1 1 `shouldBe` (Day 1)
>>>mkDay 1858 11 17 `shouldBe` (Day julian_day_offset)