Moduletime-compat-1.9.9
Data.Time.LocalTime.Compat
- 5 types
- 33 values
- Packagetime-compat-1.9.9
- Exports38
- LicenceBSD-3-Clause
- SourceCalendarDiffTime.hs
Scale by a factor. Note that scaleCalendarDiffTime (-1) will not perfectly invert a duration, due to variable month lengths.
Get the configured time-zone for the current time.
Get the configured time-zone for a given time (varying as per summertime adjustments).
On Unix systems the output of this function depends on:
The value of
TZenvironment variable (if set)The system time zone (usually configured by
/etc/localtimesymlink)
For details see tzset(3) and localtime(3).
Example:
> let t = UTCTime (fromGregorian 2021 7 1) 0
> getTimeZone t
CEST
> setEnv "TZ" "America/New_York" >> getTimeZone t
EDT
> setEnv "TZ" "Europe/Berlin" >> getTimeZone t
CEST
On Windows systems the output of this function depends on:
The value of
TZenvironment variable (if set). See here for how Windows interprets this variable.The system time zone, configured in Settings
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 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-ac1b"
'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
Instances13Eq, 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]Hashable LocalTimeDefined in time-compat-1.9.9 · Data.Time.Orphans · orphanLift 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-ac1b"
'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.
Instances13Eq, 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]Hashable TimeOfDayDefined in time-compat-1.9.9 · Data.Time.Orphans · orphanLift 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-ac1b"
'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.
Instances13Eq, 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]Hashable TimeZoneDefined in time-compat-1.9.9 · Data.Time.Orphans · orphanLift 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-ac1b"
'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-ac1b"
'False) (C1 ('MetaCons"ZonedTime"
'PrefixI 'True) (S1 ('MetaSel ('Just"zonedTimeToLocalTime"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalTime) :*: S1 ('MetaSel ('Just"zonedTimeZone"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TimeZone)))