Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Data.Time.LocalTime
A TimeZone is a whole number of minutes offset from UTC, together with a name and a "just for summer" flag.
Constructors
TimeZone | |
Fields
|
DataTimeZoneSource# | |
Instance detailsDefined inData.Time.LocalTime.Internal.TimeZone Methods gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->TimeZone -> cTimeZone# gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cTimeZone# dataTypeOf ::TimeZone ->DataType# dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cTimeZone)# dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cTimeZone)# 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 -> mTimeZone# gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->TimeZone -> mTimeZone# gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->TimeZone -> mTimeZone# | |
GenericTimeZoneSource# | |
ReadTimeZoneSource# | This only works for |
ShowTimeZoneSource# | This only shows the time zone name, or offset if the name is empty. |
NFDataTimeZoneSource# | |
EqTimeZoneSource# | |
OrdTimeZoneSource# | |
Instance detailsDefined inData.Time.LocalTime.Internal.TimeZone | |
FormatTimeTimeZoneSource# | |
Instance detailsDefined inData.Time.Format.Format.Instances Methods formatCharacter ::Bool ->Char ->Maybe (FormatOptions ->TimeZone ->String)Source# | |
ISO8601TimeZoneSource# |
|
ParseTimeTimeZoneSource# | |
Instance detailsDefined inData.Time.Format.Parse.Instances | |
typeRepTimeZoneSource# | |
Instance detailsDefined inData.Time.LocalTime.Internal.TimeZone typeRepTimeZone =D1 ('MetaData "TimeZone" "Data.Time.LocalTime.Internal.TimeZone" "time-1.14-FUp5siqKs8fGXR1yavxc1V" 'False) (C1 ('MetaCons "TimeZone" 'PrefixI 'True) (S1 ('MetaSel ('Just "timeZoneMinutes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0Int):*: (S1 ('MetaSel ('Just "timeZoneSummerOnly") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0Bool):*:S1 ('MetaSel ('Just "timeZoneName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0String)))) |
timeZoneOffsetString ::TimeZone ->StringSource#
Text representing the offset of this timezone, such as "-0800" or "+0400" (like%z
in formatTime).
timeZoneOffsetString' ::MaybeChar ->TimeZone ->StringSource#
Text representing the offset of this timezone, such as "-0800" or "+0400" (like%z
in formatTime), with arbitrary padding.
minutesToTimeZone ::Int ->TimeZoneSource#
Create a nameless non-summer timezone for this number of minutes.
hoursToTimeZone ::Int ->TimeZoneSource#
Create a nameless non-summer timezone for this number of hours.
getTimeZone ::UTCTime ->IOTimeZoneSource#
Get the configured time-zone for a given time (varying as per summertime adjustments).
On Unix systems the output of this function depends on:
TZ
environment variable (if set)/etc/localtime
symlink)For details see tzset(3) and localtime(3).
Example:
> let t =UTCTime
(fromGregorian
2021 7 1) 0>getTimeZone
tCEST>setEnv
"TZ" "America/New_York" >>getTimeZone
tEDT>setEnv
"TZ" "Europe/Berlin" >>getTimeZone
tCEST
On Windows systems the output of this function depends on:
TZ
environment variable (if set). Seehere for how Windows interprets this variable.getCurrentTimeZone ::IOTimeZoneSource#
Get the configured time-zone for the current time.
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 ofmakeTimeOfDayValid
, as well as reading and parsing, but valid for ISO 8601 parsing inData.Time.Format.ISO8601.
Constructors
TimeOfDay | |
timeToDaysAndTimeOfDay ::NominalDiffTime -> (Integer,TimeOfDay)Source#
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.
daysAndTimeOfDayToTime ::Integer ->TimeOfDay ->NominalDiffTimeSource#
Convert a count of days and a time of day since midnight into a period of time.
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.
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.
timeToTimeOfDay ::DiffTime ->TimeOfDaySource#
Get the time of day given a time since midnight. Time more than 24h will be converted to leap-seconds.
pastMidnight ::DiffTime ->TimeOfDaySource#
Same astimeToTimeOfDay
.
timeOfDayToTime ::TimeOfDay ->DiffTimeSource#
Get the time since midnight for a given time of day.
sinceMidnight ::TimeOfDay ->DiffTimeSource#
Same astimeOfDayToTime
.
dayFractionToTimeOfDay ::Rational ->TimeOfDaySource#
Get the time of day given the fraction of a day since midnight.
timeOfDayToDayFraction ::TimeOfDay ->RationalSource#
Get the fraction of a day since midnight given a time of day.
Constructors
CalendarDiffTime | |
Fields |
scaleCalendarDiffTime ::Integer ->CalendarDiffTime ->CalendarDiffTimeSource#
Scale by a factor. Note thatscaleCalendarDiffTime (-1)
will not perfectly invert a duration, due to variable month lengths.
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 |
addLocalTime ::NominalDiffTime ->LocalTime ->LocalTimeSource#
addLocalTime a b = a + b
diffLocalTime ::LocalTime ->LocalTime ->NominalDiffTimeSource#
diffLocalTime a b = a - b
utcToLocalTime ::TimeZone ->UTCTime ->LocalTimeSource#
Get the local time of a UTC time in a time zone.
localTimeToUTC ::TimeZone ->LocalTime ->UTCTimeSource#
Get the UTC time of a local time in a time zone.
ut1ToLocalTime ::Rational ->UniversalTime ->LocalTimeSource#
Get the local time of a UT1 time on a particular meridian (in degrees, positive is East).
localTimeToUT1 ::Rational ->LocalTime ->UniversalTimeSource#
Get the UT1 time of a local time on a particular meridian (in degrees, positive is East).
A local time together with a time zone.
There is noEq
instance forZonedTime
. If you want to compare local times, usezonedTimeToLocalTime
. If you want to compare absolute times, usezonedTimeToUTC
.
Constructors
ZonedTime | |
Fields |
DataZonedTimeSource# | |
Instance detailsDefined inData.Time.LocalTime.Internal.ZonedTime Methods gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->ZonedTime -> cZonedTime# gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cZonedTime# toConstr ::ZonedTime ->Constr# dataTypeOf ::ZonedTime ->DataType# dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cZonedTime)# dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cZonedTime)# 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 -> mZonedTime# gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->ZonedTime -> mZonedTime# gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->ZonedTime -> mZonedTime# | |
GenericZonedTimeSource# | |
ReadZonedTimeSource# | This only works for a |
ShowZonedTimeSource# | For the time zone, this only shows the name, or offset if the name is empty. |
NFDataZonedTimeSource# | |
FormatTimeZonedTimeSource# | |
Instance detailsDefined inData.Time.Format.Format.Instances Methods formatCharacter ::Bool ->Char ->Maybe (FormatOptions ->ZonedTime ->String)Source# | |
ISO8601ZonedTimeSource# |
|
ParseTimeZonedTimeSource# | |
Instance detailsDefined inData.Time.Format.Parse.Instances | |
typeRepZonedTimeSource# | |
Instance detailsDefined inData.Time.LocalTime.Internal.ZonedTime typeRepZonedTime =D1 ('MetaData "ZonedTime" "Data.Time.LocalTime.Internal.ZonedTime" "time-1.14-FUp5siqKs8fGXR1yavxc1V" 'False) (C1 ('MetaCons "ZonedTime" 'PrefixI 'True) (S1 ('MetaSel ('Just "zonedTimeToLocalTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0LocalTime):*:S1 ('MetaSel ('Just "zonedTimeZone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0TimeZone))) |
Produced byHaddock version 2.29.1