rio-0.1.8.0: A standard library for Haskell

Safe Haskell | Safe
Language | Haskell2010

RIO.Time

Synopsis

- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- type NumericPadOption = Maybe Char
- class FormatTime t where
  - formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> t -> String)
- readsTime :: ParseTime t => TimeLocale -> String -> ReadS t
- readTime :: ParseTime t => TimeLocale -> String -> String -> t
- parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t
- readPTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadP t
- readSTime :: ParseTime t => Bool -> TimeLocale -> String -> ReadS t
- parseTimeOrError :: ParseTime t => Bool -> TimeLocale -> String -> String -> t
- parseTimeM :: (Monad m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
- class ParseTime t where
  - buildTime :: TimeLocale -> [(Char, String)] -> Maybe t
- zonedTimeToUTC :: ZonedTime -> UTCTime
- utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
- data ZonedTime = ZonedTime {
  - zonedTimeToLocalTime :: LocalTime
  - zonedTimeZone :: TimeZone
  }
- rfc822DateFormat :: String
- iso8601DateFormat :: Maybe String -> String
- defaultTimeLocale :: TimeLocale
- data TimeLocale = TimeLocale {
  - wDays :: [(String, String)]
  - months :: [(String, String)]
  - amPm :: (String, String)
  - dateTimeFmt :: String
  - dateFmt :: String
  - timeFmt :: String
  - time12Fmt :: String
  - knownTimeZones :: [TimeZone]
  }
- localTimeToUT1 :: Rational -> LocalTime -> UniversalTime
- ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime
- localTimeToUTC :: TimeZone -> LocalTime -> UTCTime
- utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
- data LocalTime = LocalTime {
  - localDay :: Day
  - localTimeOfDay :: TimeOfDay
  }
- timeOfDayToDayFraction :: TimeOfDay -> Rational
- dayFractionToTimeOfDay :: Rational -> TimeOfDay
- timeOfDayToTime :: TimeOfDay -> DiffTime
- timeToTimeOfDay :: DiffTime -> TimeOfDay
- localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay
- midday :: TimeOfDay
- midnight :: TimeOfDay
- data TimeOfDay = TimeOfDay {
  - todHour :: Int
  - todMin :: Int
  - todSec :: Pico
  }
- utc :: TimeZone
- timeZoneOffsetString :: TimeZone -> String
- timeZoneOffsetString' :: Maybe Char -> TimeZone -> String
- hoursToTimeZone :: Int -> TimeZone
- minutesToTimeZone :: Int -> TimeZone
- data TimeZone = TimeZone {
  - timeZoneMinutes :: Int
  - timeZoneSummerOnly :: Bool
  - timeZoneName :: String
  }
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- newtype UniversalTime = ModJulianDate {
  - getModJulianDate :: Rational
  }
- data UTCTime = UTCTime {
  - utctDay :: Day
  - utctDayTime :: DiffTime
  }
- getTime_resolution :: DiffTime
- nominalDay :: NominalDiffTime
- data NominalDiffTime
- diffTimeToPicoseconds :: DiffTime -> Integer
- picosecondsToDiffTime :: Integer -> DiffTime
- secondsToDiffTime :: Integer -> DiffTime
- data DiffTime
- addGregorianYearsRollOver :: Integer -> Day -> Day
- addGregorianYearsClip :: Integer -> Day -> Day
- addGregorianMonthsRollOver :: Integer -> Day -> Day
- addGregorianMonthsClip :: Integer -> Day -> Day
- gregorianMonthLength :: Integer -> Int -> Int
- showGregorian :: Day -> String
- fromGregorianValid :: Integer -> Int -> Int -> Maybe Day
- fromGregorian :: Integer -> Int -> Int -> Day
- toGregorian :: Day -> (Integer, Int, Int)
- isLeapYear :: Integer -> Bool
- diffDays :: Day -> Day -> Integer
- addDays :: Integer -> Day -> Day
- newtype Day = ModifiedJulianDay {
  - toModifiedJulianDay :: Integer
  }
- 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

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><specifier>`, where `<modifier>` and `<width>` 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

## `<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`.
`%Z`
  timezone name

### `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`.

### `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`)
`%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`
`%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`
  day of week for Week Date format, `1` - `7`
`%a`
  day of week, short form (`snd` from `wDays` `locale`), `Sun` - `Sat`
`%A`
  day of week, long form (`fst` from `wDays` `locale`), `Sunday` - `Saturday`
`%U`
  week of year where weeks start on Sunday (as `sundayStartWeek`), 0-padded to two chars, `00` - `53`
`%w`
  day of week number, `0` (= Sunday) - `6` (= Saturday)
`%W`
  week of year where weeks start on Monday (as `mondayStartWeek`), 0-padded to two chars, `00` - `53`

type NumericPadOption = Maybe Char Source #

class FormatTime t where Source #

Methods

formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> t -> String) Source #

Instances

FormatTime ZonedTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> ZonedTime -> String) Source #
FormatTime LocalTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> LocalTime -> String) Source #
FormatTime TimeOfDay |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> TimeOfDay -> String) Source #
FormatTime TimeZone |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> TimeZone -> String) Source #
FormatTime UniversalTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> UniversalTime -> String) Source #
FormatTime UTCTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> UTCTime -> String) Source #
FormatTime Day |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> Day -> String) Source #

readsTime Source #

Arguments

:: ParseTime t |
=> TimeLocale | Time locale.
-> String | Format string
-> ReadS t |

readTime Source #

Arguments

:: ParseTime t |
=> TimeLocale | Time locale.
-> String | Format string.
-> String | Input string.
-> t | The time value.

parseTime Source #

Arguments

:: ParseTime t |
=> TimeLocale | Time locale.
-> String | Format string.
-> String | Input string.
-> Maybe t | The time value, or `Nothing` if the input could not be parsed using the given format.

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.

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.

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.

parseTimeM Source #

Arguments

:: (Monad 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. 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`
  accepts any of `-HHMM` or `-HH:MM`.
`%Z`
  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.

class ParseTime t where Source #

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

Methods

buildTime Source #

Arguments

:: TimeLocale | The time locale.
-> [(Char, String)] | Pairs of format characters and the corresponding part of the input.
-> Maybe t |

Builds a time value from a parsed input string. If the input does not include all the information needed to construct a complete value, any missing parts should be taken from 1970-01-01 00:00:00 +0000 (which was a Thursday). In the absence of `%C` or `%Y`, century is 1969 - 2068.

Instances

ParseTime ZonedTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe ZonedTime Source #
ParseTime LocalTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe LocalTime Source #
ParseTime TimeOfDay |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe TimeOfDay Source #
ParseTime TimeZone |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe TimeZone Source #
ParseTime UniversalTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe UniversalTime Source #
ParseTime UTCTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe UTCTime Source #
ParseTime Day |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe Day Source #

zonedTimeToUTC :: ZonedTime -> UTCTime Source #

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

data ZonedTime Source #

A local time together with a time zone.

Constructors

ZonedTime |

Fields

- zonedTimeToLocalTime :: LocalTime
- zonedTimeZone :: TimeZone

Instances

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 :: (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 |
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 #
FormatTime ZonedTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> ZonedTime -> String) Source #
ParseTime ZonedTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe ZonedTime Source #

rfc822DateFormat :: String Source #

Format string according to RFC822.

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

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 single-letter military time-zones and +HHMM format.

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

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 #

Show TimeLocale |
Instance details Defined in Data.Time.Format.Locale Methods showsPrec :: Int -> TimeLocale -> ShowS Source # show :: TimeLocale -> String Source # showList :: [TimeLocale] -> ShowS Source #

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

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

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

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

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

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

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

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

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

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

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 #

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 #
FormatTime LocalTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> LocalTime -> String) Source #
ParseTime LocalTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe LocalTime Source #

timeOfDayToDayFraction :: TimeOfDay -> Rational Source #

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

dayFractionToTimeOfDay :: Rational -> TimeOfDay Source #

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

timeOfDayToTime :: TimeOfDay -> DiffTime Source #

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

timeToTimeOfDay :: DiffTime -> TimeOfDay Source #

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

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.

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.

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

midday :: TimeOfDay Source #

Hour twelve

midnight :: TimeOfDay Source #

Hour zero

data TimeOfDay Source #

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

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

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

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 #

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 #
FormatTime TimeOfDay |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> TimeOfDay -> String) Source #
ParseTime TimeOfDay |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe TimeOfDay Source #

utc :: TimeZone Source #

The UTC time zone.

timeZoneOffsetString :: TimeZone -> String Source #

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

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.

hoursToTimeZone :: Int -> TimeZone Source #

Create a nameless non-summer timezone for this number of hours.

minutesToTimeZone :: Int -> TimeZone Source #

Create a nameless non-summer timezone for this number of minutes.

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

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

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 #

Show TimeZone |
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 #
FormatTime TimeZone |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> TimeZone -> String) Source #
ParseTime TimeZone |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe TimeZone Source #

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

diffUTCTime a b = a - b

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

addUTCTime a b = a + b

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

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

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 #

NFData UniversalTime |
Instance details Defined in Data.Time.Clock.Internal.UniversalTime Methods rnf :: UniversalTime -> () Source #
FormatTime UniversalTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> UniversalTime -> String) Source #
ParseTime UniversalTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe UniversalTime 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

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

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 #
NFData UTCTime |
Instance details Defined in Data.Time.Clock.Internal.UTCTime Methods rnf :: UTCTime -> () Source #
FormatTime UTCTime |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> UTCTime -> String) Source #
ParseTime UTCTime |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe UTCTime Source #

getTime_resolution :: DiffTime Source #

The resolution of `getSystemTime`, `getCurrentTime`, `getPOSIXTime`

nominalDay :: NominalDiffTime Source #

One day in `NominalDiffTime`.

data NominalDiffTime Source #

This is a length of time, as measured by UTC. Conversion functions will treat it as seconds. It has a precision of 10^-12 s. 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

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 #

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

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 #

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 #

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 #

diffTimeToPicoseconds :: DiffTime -> Integer Source #

Get the number of picoseconds in a `DiffTime`.

picosecondsToDiffTime :: Integer -> DiffTime Source #

Create a `DiffTime` from a number of picoseconds.

secondsToDiffTime :: Integer -> DiffTime Source #

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

data DiffTime Source #

This is a length of time, as measured by a clock. Conversion functions will treat it as seconds. It has a precision of 10^-12 s.

Instances

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 #

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

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 #
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 #

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 #

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.

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.

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.

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.

gregorianMonthLength :: Integer -> Int -> Int Source #

The number of days in a given month according to the proleptic Gregorian calendar. First argument is year, second is month.

showGregorian :: Day -> String Source #

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

fromGregorianValid :: Integer -> Int -> Int -> Maybe Day Source #

Convert from proleptic Gregorian calendar. First argument is year, second month number (1-12), third day (1-31). Invalid values will return Nothing

fromGregorian :: Integer -> Int -> Int -> Day Source #

Convert from proleptic Gregorian calendar. First argument is year, second month number (1-12), third day (1-31). Invalid values will be clipped to the correct range, month first, then day.

toGregorian :: Day -> (Integer, Int, Int) Source #

Convert to proleptic Gregorian calendar. First element of result is year, second month number (1-12), third day (1-31).

isLeapYear :: Integer -> Bool Source #

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

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

addDays :: Integer -> 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

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 #
Eq Day |
Instance details Defined in Data.Time.Calendar.Days Methods (==) :: Day -> Day -> Bool Source # (/=) :: Day -> Day -> Bool Source #
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 :: (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 #

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 #
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 inRange :: (Day, Day) -> Day -> Bool Source # rangeSize :: (Day, Day) -> Int Source # unsafeRangeSize :: (Day, Day) -> Int
NFData Day |
Instance details Defined in Data.Time.Calendar.Days Methods rnf :: Day -> () Source #
FormatTime Day |
Instance details Defined in Data.Time.Format Methods formatCharacter :: Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> Maybe Int -> Day -> String) Source #
ParseTime Day |
Instance details Defined in Data.Time.Format.Parse Methods buildTime :: TimeLocale -> [(Char, String)] -> Maybe Day Source #

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 #