Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- 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 :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m t
- zonedTimeToUTC :: ZonedTime -> UTCTime
- utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime
- data ZonedTime = ZonedTime {}
- formatTime :: FormatTime t => TimeLocale -> String -> t -> String
- class FormatTime t
- class ParseTime t
- rfc822DateFormat :: String
- iso8601DateFormat :: Maybe String -> String
- defaultTimeLocale :: TimeLocale
- data TimeLocale = TimeLocale {}
- localTimeToUT1 :: Rational -> LocalTime -> UniversalTime
- ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime
- localTimeToUTC :: TimeZone -> LocalTime -> UTCTime
- utcToLocalTime :: TimeZone -> UTCTime -> LocalTime
- diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime
- addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime
- data LocalTime = LocalTime {}
- timeOfDayToDayFraction :: TimeOfDay -> Rational
- dayFractionToTimeOfDay :: Rational -> TimeOfDay
- timeOfDayToTime :: TimeOfDay -> DiffTime
- timeToTimeOfDay :: DiffTime -> TimeOfDay
- localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Integer, TimeOfDay)
- daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime
- timeToDaysAndTimeOfDay :: NominalDiffTime -> (Integer, TimeOfDay)
- makeTimeOfDayValid :: Int -> Int -> Pico -> Maybe TimeOfDay
- midday :: TimeOfDay
- midnight :: TimeOfDay
- data TimeOfDay = TimeOfDay {}
- utc :: TimeZone
- timeZoneOffsetString :: TimeZone -> String
- timeZoneOffsetString' :: Maybe Char -> TimeZone -> String
- hoursToTimeZone :: Int -> TimeZone
- minutesToTimeZone :: Int -> TimeZone
- data TimeZone = TimeZone {}
- scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime
- calendarTimeTime :: NominalDiffTime -> CalendarDiffTime
- calendarTimeDays :: CalendarDiffDays -> CalendarDiffTime
- data CalendarDiffTime = CalendarDiffTime {}
- diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime
- addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime
- newtype UniversalTime = ModJulianDate {}
- data UTCTime = UTCTime {
- utctDay :: Day
- utctDayTime :: DiffTime
- getTime_resolution :: DiffTime
- nominalDay :: NominalDiffTime
- nominalDiffTimeToSeconds :: NominalDiffTime -> Pico
- secondsToNominalDiffTime :: Pico -> NominalDiffTime
- data NominalDiffTime
- diffTimeToPicoseconds :: DiffTime -> Integer
- picosecondsToDiffTime :: Integer -> DiffTime
- secondsToDiffTime :: Integer -> DiffTime
- data DiffTime
- dayOfWeek :: Day -> DayOfWeek
- data DayOfWeek
- diffGregorianDurationRollOver :: Day -> Day -> CalendarDiffDays
- diffGregorianDurationClip :: Day -> Day -> CalendarDiffDays
- addGregorianDurationRollOver :: CalendarDiffDays -> Day -> Day
- addGregorianDurationClip :: CalendarDiffDays -> Day -> Day
- 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 {}
- scaleCalendarDiffDays :: Integer -> CalendarDiffDays -> CalendarDiffDays
- calendarYear :: CalendarDiffDays
- calendarMonth :: CalendarDiffDays
- calendarWeek :: CalendarDiffDays
- calendarDay :: CalendarDiffDays
- data CalendarDiffDays = CalendarDiffDays {}
- 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
:: ParseTime t | |
=> TimeLocale | Time locale. |
-> String | Format string. |
-> String | Input string. |
-> t | The time value. |
:: 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.
:: 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.
:: 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.
:: (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.
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.
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
zonedTimeToUTC :: ZonedTime -> UTCTime #
utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime #
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
.
Instances
Data ZonedTime | |
Defined in Data.Time.LocalTime.Internal.ZonedTime 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 | |
NFData ZonedTime | |
Defined in Data.Time.LocalTime.Internal.ZonedTime |
formatTime :: FormatTime t => TimeLocale -> String -> t -> String #
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
fromwDays
locale
),Sun
-Sat
%A
- day of week, long form (
fst
fromwDays
locale
),Sunday
-Saturday
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
frommonths
locale
),January
-December
%b
,%h
- month name, short form (
snd
frommonths
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
- 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.
class FormatTime t #
The class of types which can be parsed given a UNIX-style time format string.
Format string according to RFC822.
iso8601DateFormat :: Maybe String -> String #
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 #
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.
data TimeLocale #
TimeLocale | |
|
Instances
Eq TimeLocale | |
Defined in Data.Time.Format.Locale (==) :: TimeLocale -> TimeLocale -> Bool # (/=) :: TimeLocale -> TimeLocale -> Bool # | |
Ord TimeLocale | |
Defined in Data.Time.Format.Locale compare :: TimeLocale -> TimeLocale -> Ordering # (<) :: TimeLocale -> TimeLocale -> Bool # (<=) :: TimeLocale -> TimeLocale -> Bool # (>) :: TimeLocale -> TimeLocale -> Bool # (>=) :: TimeLocale -> TimeLocale -> Bool # max :: TimeLocale -> TimeLocale -> TimeLocale # min :: TimeLocale -> TimeLocale -> TimeLocale # | |
Show TimeLocale | |
Defined in Data.Time.Format.Locale showsPrec :: Int -> TimeLocale -> ShowS # show :: TimeLocale -> String # showList :: [TimeLocale] -> ShowS # |
localTimeToUT1 :: Rational -> LocalTime -> UniversalTime #
Get the UT1 time of a local time on a particular meridian (in degrees, positive is East).
ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime #
Get the local time of a UT1 time on a particular meridian (in degrees, positive is East).
localTimeToUTC :: TimeZone -> LocalTime -> UTCTime #
Get the UTC time of a local time in a time zone.
utcToLocalTime :: TimeZone -> UTCTime -> LocalTime #
Get the local time of a UTC time in a time zone.
diffLocalTime :: LocalTime -> LocalTime -> NominalDiffTime #
diffLocalTime a b = a - b
addLocalTime :: NominalDiffTime -> LocalTime -> LocalTime #
addLocalTime a b = a + b
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.
Instances
Eq LocalTime | |
Data LocalTime | |
Defined in Data.Time.LocalTime.Internal.LocalTime 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 | |
Defined in Data.Time.LocalTime.Internal.LocalTime | |
Show LocalTime | |
NFData LocalTime | |
Defined in Data.Time.LocalTime.Internal.LocalTime |
timeOfDayToDayFraction :: TimeOfDay -> Rational #
Get the fraction of a day since midnight given a time of day.
dayFractionToTimeOfDay :: Rational -> TimeOfDay #
Get the time of day given the fraction of a day since midnight.
timeOfDayToTime :: TimeOfDay -> DiffTime #
Get the time since midnight for a given time of day.
timeToTimeOfDay :: DiffTime -> TimeOfDay #
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) #
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) #
Convert a time of day in UTC to a time of day in some timezone, together with a day adjustment.
daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime #
Convert a count of days and a time of day since midnight into a period of time.
timeToDaysAndTimeOfDay :: NominalDiffTime -> (Integer, TimeOfDay) #
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.
Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.
Instances
Eq TimeOfDay | |
Data TimeOfDay | |
Defined in Data.Time.LocalTime.Internal.TimeOfDay 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 | |
Defined in Data.Time.LocalTime.Internal.TimeOfDay | |
Show TimeOfDay | |
NFData TimeOfDay | |
Defined in Data.Time.LocalTime.Internal.TimeOfDay |
timeZoneOffsetString :: TimeZone -> String #
Text representing the offset of this timezone, such as "-0800" or "+0400" (like %z
in formatTime).
timeZoneOffsetString' :: Maybe Char -> TimeZone -> String #
Text representing the offset of this timezone, such as "-0800" or "+0400" (like %z
in formatTime), with arbitrary padding.
hoursToTimeZone :: Int -> TimeZone #
Create a nameless non-summer timezone for this number of hours.
minutesToTimeZone :: Int -> TimeZone #
Create a nameless non-summer timezone for this number of minutes.
A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.
TimeZone | |
|
Instances
Eq TimeZone | |
Data TimeZone | |
Defined in Data.Time.LocalTime.Internal.TimeZone 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 | |
Defined in Data.Time.LocalTime.Internal.TimeZone | |
Show TimeZone | This only shows the time zone name, or offset if the name is empty. |
NFData TimeZone | |
Defined in Data.Time.LocalTime.Internal.TimeZone |
scaleCalendarDiffTime :: Integer -> CalendarDiffTime -> CalendarDiffTime #
Scale by a factor. Note that scaleCalendarDiffTime (-1)
will not perfectly invert a duration, due to variable month lengths.
data CalendarDiffTime #
Instances
diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime #
diffUTCTime a b = a - b
addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime #
addUTCTime a b = a + b
newtype UniversalTime #
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.
Instances
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.
UTCTime | |
|
Instances
Eq UTCTime | |
Data UTCTime | |
Defined in Data.Time.Clock.Internal.UTCTime 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 # | |
Ord UTCTime | |
Defined in Data.Time.Clock.Internal.UTCTime | |
NFData UTCTime | |
Defined in Data.Time.Clock.Internal.UTCTime |
getTime_resolution :: DiffTime #
The resolution of getSystemTime
, getCurrentTime
, getPOSIXTime
nominalDay :: NominalDiffTime #
One day in NominalDiffTime
.
nominalDiffTimeToSeconds :: NominalDiffTime -> Pico #
Get the seconds in a NominalDiffTime
.
Since: time-1.9.1
secondsToNominalDiffTime :: Pico -> NominalDiffTime #
Create a NominalDiffTime
from a number of seconds.
Since: time-1.9.1
data NominalDiffTime #
This is a length of time, as measured by UTC. It has a precision of 10^-12 s.
Conversion functions will treat it as seconds.
For example, (0.010 :: NominalDiffTime)
corresponds to 10 milliseconds.
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
diffTimeToPicoseconds :: DiffTime -> Integer #
Get the number of picoseconds in a DiffTime
.
picosecondsToDiffTime :: Integer -> DiffTime #
Create a DiffTime
from a number of picoseconds.
secondsToDiffTime :: Integer -> DiffTime #
Create a DiffTime
which represents an integral number of seconds.
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 | |
Defined in Data.Time.Clock.Internal.DiffTime | |
Eq DiffTime | |
Fractional DiffTime | |
Data DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime 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 # | |
Num DiffTime | |
Ord DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime | |
Real DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime toRational :: DiffTime -> Rational # | |
RealFrac DiffTime | |
Show DiffTime | |
NFData DiffTime | |
Defined in Data.Time.Clock.Internal.DiffTime |
Instances
Enum DayOfWeek | "Circular", so for example |
Defined in Data.Time.Calendar.Week succ :: DayOfWeek -> DayOfWeek # pred :: DayOfWeek -> DayOfWeek # fromEnum :: DayOfWeek -> Int # enumFrom :: DayOfWeek -> [DayOfWeek] # enumFromThen :: DayOfWeek -> DayOfWeek -> [DayOfWeek] # enumFromTo :: DayOfWeek -> DayOfWeek -> [DayOfWeek] # enumFromThenTo :: DayOfWeek -> DayOfWeek -> DayOfWeek -> [DayOfWeek] # | |
Eq DayOfWeek | |
Read DayOfWeek | |
Show DayOfWeek | |
diffGregorianDurationRollOver :: Day -> Day -> CalendarDiffDays #
Calendrical difference, with as many whole months as possible.
Same as diffGregorianDurationClip
for positive durations.
diffGregorianDurationClip :: Day -> Day -> CalendarDiffDays #
Calendrical difference, with as many whole months as possible
addGregorianDurationRollOver :: CalendarDiffDays -> Day -> Day #
Add months (rolling over to next month), then add days
addGregorianDurationClip :: CalendarDiffDays -> Day -> Day #
Add months (clipped to last day), then add days
addGregorianYearsRollOver :: Integer -> Day -> Day #
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 #
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 #
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 #
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 #
The number of days in a given month according to the proleptic Gregorian calendar. First argument is year, second is month.
showGregorian :: Day -> String #
Show in ISO 8601 format (yyyy-mm-dd)
fromGregorianValid :: Integer -> Int -> Int -> Maybe Day #
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 #
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) #
Convert to proleptic Gregorian calendar. First element of result is year, second month number (1-12), third day (1-31).
isLeapYear :: Integer -> Bool #
Is this year a leap year according to the proleptic Gregorian calendar?
The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.
Instances
Enum Day | |
Eq Day | |
Data Day | |
Defined in Data.Time.Calendar.Days gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day # dataTypeOf :: Day -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Day) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) # gmapT :: (forall b. Data b => b -> b) -> Day -> Day # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r # gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day # | |
Ord Day | |
Ix Day | |
NFData Day | |
Defined in Data.Time.Calendar.Days |
scaleCalendarDiffDays :: Integer -> CalendarDiffDays -> CalendarDiffDays #
Scale by a factor. Note that scaleCalendarDiffDays (-1)
will not perfectly invert a duration, due to variable month lengths.
data CalendarDiffDays #
Instances
getCurrentTime :: MonadIO m => m UTCTime Source #
getCurrentTimeZone :: MonadIO m => m TimeZone Source #
getZonedTime :: MonadIO m => m ZonedTime Source #