Modulerio-0.1.25.0Haskell2010
RIO.Time
- 16 types
- 3 classes
- 95 values
- Packagerio-0.1.25.0
- Exports134
- LanguageHaskell2010
- LicenceMIT
- SourceCalendarDiffDays.hs
Scale by a factor. Note that scaleCalendarDiffDays (-1) will not perfectly invert a duration, due to variable month lengths.
A list of all the days in this period.
Get the period this day is in, with the 1-based day number within the period.
periodFromDay (periodFirstDay p) = (p,1)Test whether a day is in a given period.
The number of days in this period.
Inverse of periodFromDay.
Inverse of periodFromDay, clipping the day number to the period.
Validating inverse of periodFromDay.
Bidirectional abstract constructor for the proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.
Add months (clipped to last day), then add days
Add months (rolling over to next month), then add days
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.
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.
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.
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.
Calendrical difference, with as many whole months as possible.
Has the property addGregorianDurationClip (diffGregorianDurationClip d2 d1) d1 = d2.
For example, 2027-03-01 - 2027-01-31 = 1 month and 1 day.
Calendrical difference, with as many whole months as possible.
Has the property addGregorianDurationRollOver (diffGregorianDurationRollOver d2 d1) d1 = d2.
For example, 2027-03-01 - 2027-01-31 = 29 days.
Convert from proleptic Gregorian calendar. Invalid values will be clipped to the correct range, month first, then day.
Convert from proleptic Gregorian calendar. Invalid values will return Nothing
The number of days in a given month according to the proleptic Gregorian calendar.
Show in ISO 8601 format (yyyy-mm-dd)
Convert to proleptic Gregorian calendar.
Is this year a leap year according to the proleptic Gregorian calendar?
Also known as Before Christ.
Note that Year 1 = 1 CE, and the previous Year 0 = 1 BCE.
CommonEra and BeforeCommonEra form a COMPLETE set.
Also known as Anno Domini.
The twelve MonthOfYear patterns form a COMPLETE set.
dayOfWeekDiff a b = a - b in range 0 to 6.
The number of days from b to the next a.
The first day-of-week on or after some day
Returns a week containing the given Day where the first day is the DayOfWeek specified.
Examples:
weekAllDays Sunday (YearMonthDay 2022 02 21)[YearMonthDay 2022 2 20 .. YearMonthDay 2022 2 26]
weekAllDays Monday (YearMonthDay 2022 02 21)[YearMonthDay 2022 2 21 .. YearMonthDay 2022 2 27]
weekAllDays Tuesday (YearMonthDay 2022 02 21)[YearMonthDay 2022 2 15 .. YearMonthDay 2022 2 21]
Returns the first day of a week containing the given Day.
Examples:
weekFirstDay Sunday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 20
weekFirstDay Monday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 21
weekFirstDay Tuesday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 15
Returns the last day of a week containing the given Day.
Examples:
weekLastDay Sunday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 26
weekLastDay Monday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 27
weekLastDay Tuesday (YearMonthDay 2022 02 21)YearMonthDay 2022 2 21
Get the number of picoseconds in a DiffTime.
Create a DiffTime from a number of picoseconds.
Create a DiffTime which represents an integral number of seconds.
convert from DiffTime
One day in NominalDiffTime.
Get the seconds in a NominalDiffTime.
Create a NominalDiffTime from a number of seconds.
The resolution of getSystemTime, getCurrentTime, getPOSIXTime.
On UNIX systems this uses clock_getres, which may be wrong on WSL2.
addUTCTime a b = a + b
diffUTCTime a b = a - b
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):
%-zno padding
%_zpad with spaces
%0zpad with zeros
%^zconvert to upper case
%#zconvert 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:
%4zpad to 4 characters (with default padding character)
%_12zpad with spaces to 12 characters
<alternate>
An optional E character indicates an alternate formatting. Currently this only affects %Z and %z.
%Ezalternate formatting
<specifier>
For all types (note these three are done by formatTime, not by formatCharacter):
%%%%ttab
%nnewline
TimeZone
For TimeZone (and ZonedTime and UTCTime):
%ztimezone offset in the format
±HHMM%Eztimezone offset in the format
±HH:MM%Ztimezone name (or else offset in the format
±HHMM)
%EZtimezone name (or else offset in the format
±HH:MM)
LocalTime
For LocalTime (and ZonedTime and UTCTime and UniversalTime):
%cas
locale(e.g.
%a %b %e %H:%M:%S %Z %Y)
TimeOfDay
For TimeOfDay (and LocalTime and ZonedTime and UTCTime and UniversalTime):
%Rsame as
%H:%M%Tsame as
%H:%M:%S%Xas
locale(e.g.
%H:%M:%S)
%ras
locale(e.g.
%I:%M:%S %p)
%Pday-half of day from (
locale), converted to lowercase,
am,
pm%pday-half of day from (
locale),
AM,
PM%Hhour of day (24-hour), 0-padded to two chars,
00-
23%khour of day (24-hour), space-padded to two chars,
0-
23%Ihour of day-half (12-hour), 0-padded to two chars,
01-
12%lhour of day-half (12-hour), space-padded to two chars,
1-
12%Mminute of hour, 0-padded to two chars,
00-
59%Ssecond of minute (without decimal part), 0-padded to two chars,
00-
60%qpicosecond of second, 0-padded to twelve chars,
000000000000-
999999999999.
%Qdecimal point and fraction of second, up to 12 second decimals, without trailing zeros. For a whole number of seconds,
%Qomits the decimal point unless padding is specified.
UTCTime and ZonedTime
For UTCTime and ZonedTime:
%snumber of whole seconds since the Unix epoch. For times before the Unix epoch, this is a negative number. Note that in
%s.%qand
%s%Qthe decimals are positive, not negative. For example, 0.9 seconds before the Unix epoch is formatted as
-1.1with
%s%Q.
DayOfWeek
For DayOfWeek (and Day and LocalTime and ZonedTime and UTCTime and UniversalTime):
%uday of week number for Week Date format,
1(= Monday) -
7(= Sunday)
%wday of week number,
0(= Sunday) -
6(= Saturday)
%aday of week, short form (
from
locale),
Sun-
Sat%Aday of week, long form (
from
locale),
Sunday-
Saturday
QuarterOfYear
For QuarterOfYear (and Quarter and Month and Day and LocalTime and ZonedTime and UTCTime and UniversalTime):
%vquarter number,
1-
4
Quarter
For Quarter (and Month and Day and LocalTime and ZonedTime and UTCTime and UniversalTime):
%Yyear, no padding. Note
%0Yand
%_Ypad to four chars
%yyear of century, 0-padded to two chars,
00-
99%Ccentury, no padding. Note
%0Cand
%_Cpad to two chars
%vquarter number,
1-
4
Month
For Month (and Day and LocalTime and ZonedTime and UTCTime and UniversalTime):
%Bmonth name, long form (
from
locale),
January-
December%b,%hmonth name, short form (
from
locale),
Jan-
Dec%mmonth of year, 0-padded to two chars,
01-
12
Day
For Day (and LocalTime and ZonedTime and UTCTime and UniversalTime):
%Dsame as
%m/%d/%y%Fsame as
%Y-%m-%d%xas
locale(e.g.
%m/%d/%y)
%dday of month, 0-padded to two chars,
01-
31%eday of month, space-padded to two chars,
1-
31%jday of year, 0-padded to three chars,
001-
366%Gyear for ISO 8601 Week Date format. Note
%0Gand
%_Gpad to four chars
%gyear of century for ISO 8601 Week Date format, 0-padded to two chars,
00-
99%fcentury for ISO 8601 Week Date format, no padding. Note
%0fand
%_fpad to two chars
%Vweek of year for ISO 8601 Week Date format, 0-padded to two chars,
01-
53%Uweek of year where weeks start on Sunday (as
sundayStartWeek), 0-padded to two chars,
00-
53%Wweek 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:
%wtotal whole weeks
%dtotal whole days
%Dwhole days of week
%htotal whole hours
%Hwhole hours of day
%mtotal whole minutes
%Mwhole minutes of hour
%stotal whole seconds
%Estotal seconds, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds,
%Esomits the decimal point unless padding is specified.
%0Estotal seconds, with decimal point and <width> (default 12) decimal places.
%Swhole seconds of minute
%ESseconds of minute, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds,
%ESomits the decimal point unless padding is specified.
%0ESseconds of minute as two digits, with decimal point and <width> (default 12) decimal places.
CalendarDiffDays
For CalendarDiffDays (and CalendarDiffTime):
%ytotal years
%btotal months
%Bmonths of year
%wtotal weeks, not including months
%dtotal days, not including months
%Ddays of week
CalendarDiffTime
For CalendarDiffTime:
%htotal hours, not including months
%Hhours of day
%mtotal minutes, not including months
%Mminutes of hour
%stotal whole seconds, not including months
%Estotal seconds, not including months, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds,
%Esomits the decimal point unless padding is specified.
%0Estotal seconds, not including months, with decimal point and <width> (default 12) decimal places.
%Swhole seconds of minute
%ESseconds of minute, with decimal point and up to <width> (default 12) decimal places, without trailing zeros. For a whole number of seconds,
%ESomits the decimal point unless padding is specified.
%0ESseconds of minute as two digits, with decimal point and <width> (default 12) decimal places.
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.
Deprecated. use Data.Time.Format.ISO8601 functions instead
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
Format string according to RFC822.
parseTimeM Parses a time value given a format string.
Missing information will be derived from 1970-01-01 00:00 UTC (which was a Thursday).
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%Ezaccepts any of
±HHMMor
±HH:MM.
%Z%EZaccepts any string of letters, or any of the formats accepted by
%z.
%0Yaccepts exactly four digits.
%0Gaccepts exactly four digits.
%0Caccepts exactly two digits.
%0faccepts 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-04parseTimeMultipleM Parses a time value given a list of pairs of format and input. Resulting value is constructed from all provided specifiers.
parseTimeOrError :: ParseTime t=> BoolAccept leading and trailing whitespace?
-> TimeLocaleTime locale.
-> StringFormat string.
-> StringInput string.
-> tThe 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.
readPTime :: ParseTime t=> BoolAccept leading whitespace?
-> TimeLocaleTime locale.
-> StringFormat string
-> ReadP t
Parse a time value given a format string. See parseTimeM for details.
readSTime :: ParseTime t=> BoolAccept leading whitespace?
-> TimeLocaleTime locale.
-> StringFormat string
-> ReadS t
Parse a time value given a format string. See parseTimeM for details.
Scale by a factor. Note that scaleCalendarDiffTime (-1) will not perfectly invert a duration, due to variable month lengths.
addLocalTime a b = a + b
diffLocalTime a b = a - b
Get the UT1 time of a local time on a particular meridian (in degrees, positive is East).
Get the UTC time of a local time in a time zone.
Get the local time of a UT1 time on a particular meridian (in degrees, positive is East).
Get the local time of a UTC time in a time zone.
Get the time of day given the fraction of a day since midnight.
Convert a count of days and a time of day since midnight into a period of time.
Convert a time of day in some timezone to a time of day in UTC, together with a day adjustment.
Hour twelve
Hour zero
Same as timeToTimeOfDay.
Same as timeOfDayToTime.
Get the fraction of a day since midnight given a time of day.
Get the time since midnight for a given time of day.
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.
Get the time of day given a time since midnight. Time more than 24h will be converted to leap-seconds.
Convert a time of day in UTC to a time of day in some timezone, together with a day adjustment.
Create a nameless non-summer timezone for this number of hours.
Create a nameless non-summer timezone for this number of minutes.
Text representing the offset of this timezone, such as "-0800" or "+0400" (like %z in formatTime).
Text representing the offset of this timezone, such as "-0800" or "+0400" (like %z in formatTime), with arbitrary padding.
The UTC time zone.
Constructors
Instances13Eq, Data, Read, Show, Generic, Semigroup, …
Eq CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysData CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysRead CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanShow CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanGeneric CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysSemigroup CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysAdditive
Monoid CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysAdditive
NFData CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysFormatTime CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.ISO8601PyYmMdD[ISO 8601:2004(E) sec. 4.4.3.2]Lift CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaystype Rep CalendarDiffDays = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDays"CalendarDiffDays"
"Data.Time.Calendar.CalendarDiffDays"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"CalendarDiffDays"
'PrefixI 'True) (S1 ('MetaSel ('Just"cdMonths"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just"cdDays"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.
Constructors
Instances15Enum, Eq, Data, Ord, Read, Show, …
Enum DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysEq DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysData DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysOrd DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysRead DayDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanShow DayDefined in time-1.16.0.1 · Data.Time.Calendar.Gregorian · orphanIx DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysGeneric DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysNFData DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysDayPeriod DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysFormatTime DayDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime DayDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 DayDefined in time-1.16.0.1 · Data.Time.Format.ISO8601yyyy-mm-dd[ISO 8601:2004(E) sec. 4.1.2.2 extended format]Lift DayDefined in time-1.16.0.1 · Data.Time.Calendar.Daystype Rep Day = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.Calendar.Days"Day"
"Data.Time.Calendar.Days"
"time-1.16.0.1-ea35"
'True) (C1 ('MetaCons"ModifiedJulianDay"
'PrefixI 'True) (S1 ('MetaSel ('Just"toModifiedJulianDay"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))
The class of types which can be represented as a period of days.
Methods
periodFirstDay :: p -> DayReturns the first Day in a period of days.
periodLastDay :: p -> DayReturns the last Day in a period of days.
dayPeriod :: Day -> pGet the period this day is in.
Day of month, in range 1 to 31.
Month of year, in range 1 (January) to 12 (December).
Year of Common Era (when positive).
Instances13Enum, Eq, Data, Ord, Read, Show, …
Enum DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekEq DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekData DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekOrd DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekRead DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekShow DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekIx DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekGeneric DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekNFData DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekFormatTime DayOfWeekDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime DayOfWeekDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanLift DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.Weektype Rep DayOfWeek = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.Calendar.Week"DayOfWeek"
"Data.Time.Calendar.Week"
"time-1.16.0.1-ea35"
'False) ((C1 ('MetaCons"Monday"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Tuesday"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Wednesday"
'PrefixI 'False) U1)) :+: ((C1 ('MetaCons"Thursday"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Friday"
'PrefixI 'False) U1) :+: (C1 ('MetaCons"Saturday"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Sunday"
'PrefixI 'False) U1)))
This is a length of time, as measured by a clock.
Conversion functions such as fromInteger and realToFrac will treat it as seconds.
For example, (0.010 :: DiffTime) corresponds to 10 milliseconds.
It has a precision of one picosecond (= 10^-12 s). Enumeration functions will treat it as picoseconds.
Instances14Enum, Eq, Fractional, Data, Num, Ord, …
Enum DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeEq DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeFractional DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeData DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeNum DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeOrd DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeRead DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeReal DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeRealFrac DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeShow DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeNFData DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeFormatTime DiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime DiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanLift DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTime
This is a length of time, as measured by UTC. It has a precision of one picosecond (10^-12 s).
Conversion functions such as fromInteger and realToFrac will treat it as seconds.
For example, (0.010 :: NominalDiffTime) corresponds to 10 milliseconds.
Enumeration functions will treat it as picoseconds.
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.
Instances14Enum, Eq, Fractional, Data, Num, Ord, …
Enum NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeEq NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeFractional NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeData NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeNum NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeOrd NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeRead NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeReal NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeRealFrac NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeShow NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeNFData NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeFormatTime NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanLift NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTime
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
UTCTimeutctDay :: Daythe day
utctDayTime :: DiffTimethe time from midnight, 0 <= t < 86401s (because of leap-seconds)
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeData UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeOrd UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeRead UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanShow UTCTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTime · orphanGeneric UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeNFData UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeFormatTime UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601yyyy-mm-ddThh:mm:ss[.ss]Z[ISO 8601:2004(E) sec. 4.3.2 extended format]Lift UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimetype Rep UTCTime = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTime"UTCTime"
"Data.Time.Clock.Internal.UTCTime"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"UTCTime"
'PrefixI 'True) (S1 ('MetaSel ('Just"utctDay"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just"utctDayTime"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DiffTime)))
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
Instances11Eq, Data, Ord, Read, Show, Generic, …
Eq UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeData UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeOrd UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeRead UniversalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanShow UniversalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTime · orphanGeneric UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeNFData UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeFormatTime UniversalTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime UniversalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanLift UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimetype Rep UniversalTime = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTime"UniversalTime"
"Data.Time.Clock.Internal.UniversalTime"
"time-1.16.0.1-ea35"
'True) (C1 ('MetaCons"ModJulianDate"
'PrefixI 'True) (S1 ('MetaSel ('Just"getModJulianDate"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Rational)))
Instances15FormatTime, …
FormatTime CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime DayDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime MonthDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime QuarterDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime DayOfWeekDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime DiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime UniversalTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanFormatTime ZonedTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphan
Constructors
TimeLocalewDays :: [(String, String)]full and abbreviated week days, starting with Sunday
months :: [(String, String)]full and abbreviated months
amPm :: (String, String)AM/PM symbols
dateTimeFmt :: Stringformatting strings
dateFmt :: Stringformatting strings
timeFmt :: Stringformatting strings
time12Fmt :: Stringformatting strings
knownTimeZones :: [TimeZone]time zones known by name
Instances3Eq, Ord, Show
Eq TimeLocaleDefined in time-1.16.0.1 · Data.Time.Format.LocaleOrd TimeLocaleDefined in time-1.16.0.1 · Data.Time.Format.LocaleShow TimeLocaleDefined in time-1.16.0.1 · Data.Time.Format.Locale
The class of types which can be parsed given a UNIX-style time format string.
Instances15ParseTime, …
ParseTime CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime DayDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime MonthDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime QuarterDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime DayOfWeekDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime DiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime UniversalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanParseTime ZonedTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphan
Constructors
Instances13Eq, Data, Read, Show, Generic, Semigroup, …
Eq CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeData CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeRead CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanShow CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanGeneric CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeSemigroup CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeAdditive
Monoid CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeAdditive
NFData CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeFormatTime CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601PyYmMdDThHmMs[.ss]S[ISO 8601:2004(E) sec. 4.4.3.2]Lift CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimetype Rep CalendarDiffTime = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTime"CalendarDiffTime"
"Data.Time.LocalTime.Internal.CalendarDiffTime"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"CalendarDiffTime"
'PrefixI 'True) (S1 ('MetaSel ('Just"ctMonths"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just"ctTime"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime)))
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
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeData LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeOrd LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeRead LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanShow LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeGeneric LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeNFData LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeFormatTime LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601yyyy-mm-ddThh:mm:ss[.ss][ISO 8601:2004(E) sec. 4.3.2 extended format]Lift LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimetype Rep LocalTime = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTime"LocalTime"
"Data.Time.LocalTime.Internal.LocalTime"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"LocalTime"
'PrefixI 'True) (S1 ('MetaSel ('Just"localDay"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just"localTimeOfDay"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TimeOfDay)))
Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.
TimeOfDay 24 0 0 is considered invalid for the purposes of makeTimeOfDayValid, as well as reading and parsing,
but valid for ISO 8601 parsing in Data.Time.Format.ISO8601.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayData TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayOrd TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayRead TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanShow TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayGeneric TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayNFData TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayFormatTime TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.ISO8601hh:mm:ss[.ss][ISO 8601:2004(E) sec. 4.2.2.2, 4.2.2.4(a) extended format]Lift TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDaytype Rep TimeOfDay = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDay"TimeOfDay"
"Data.Time.LocalTime.Internal.TimeOfDay"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"TimeOfDay"
'PrefixI 'True) (S1 ('MetaSel ('Just"todHour"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just"todMin"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just"todSec"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pico))))
A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.
Constructors
TimeZonetimeZoneMinutes :: IntThe number of minutes offset from UTC. Positive means local time will be later in the day than UTC.
timeZoneSummerOnly :: BoolIs this time zone just persisting for the summer?
timeZoneName :: StringThe name of the zone, typically a three- or four-letter acronym.
Instances12Eq, Data, Ord, Read, Show, Generic, …
Eq TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneData TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneOrd TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneRead TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanThis only works for
±HHMMformat, single-letter military time-zones, and these time-zones: "UTC", "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT", per RFC 822 section 5.Show TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneThis only shows the time zone name, or offset if the name is empty.
Generic TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneNFData TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneFormatTime TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.ISO8601±hh:mm[ISO 8601:2004(E) sec. 4.2.5.1 extended format]Lift TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZonetype Rep TimeZone = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZone"TimeZone"
"Data.Time.LocalTime.Internal.TimeZone"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"TimeZone"
'PrefixI 'True) (S1 ('MetaSel ('Just"timeZoneMinutes"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just"timeZoneSummerOnly"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just"timeZoneName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))
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.
Constructors
Instances10Data, Read, Show, Generic, NFData, FormatTime, …
Data ZonedTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTimeRead ZonedTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanThis only works for a zonedTimeZone in
±HHMMformat, single-letter military time-zones, and these time-zones: "UTC", "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT", per RFC 822 section 5.Show ZonedTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTimeFor the time zone, this only shows the name, or offset if the name is empty.
Generic ZonedTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTimeNFData ZonedTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTimeFormatTime ZonedTimeDefined in time-1.16.0.1 · Data.Time.Format.Format.Instances · orphanParseTime ZonedTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse.Instances · orphanISO8601 ZonedTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601yyyy-mm-ddThh:mm:ss[.ss]±hh:mm[ISO 8601:2004(E) sec. 4.3.2 extended format]Lift ZonedTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTimetype Rep ZonedTime = D1 ('MetaDataDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTime"ZonedTime"
"Data.Time.LocalTime.Internal.ZonedTime"
"time-1.16.0.1-ea35"
'False) (C1 ('MetaCons"ZonedTime"
'PrefixI 'True) (S1 ('MetaSel ('Just"zonedTimeToLocalTime"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalTime) :*: S1 ('MetaSel ('Just"zonedTimeZone"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TimeZone)))