- class HasTime a where
- hours :: HasTime a => Lens a Int
- minutes :: HasTime a => Lens a Int
- seconds :: HasTime a => Lens a Pico
- class HasDate a where
- year :: HasDate a => Lens a Integer
- month :: HasDate a => Lens a Int
- day :: HasDate a => Lens a Int
- gregorian :: HasDate a => Lens a (Integer, Int, Int)
- class HasTime a => HasTimeZone a where
- data Day
- data TimeOfDay
- data LocalTime
- data ZonedTime
- getZonedTime :: IO ZonedTime
- data Lens a b
- getL :: Lens a b -> a -> b
- modL :: Lens a b -> (b -> b) -> a -> a
- setL :: Lens a b -> b -> a -> a
modL minutes (+5) (TimeOfDay 16 57 13)17:02:13
If this means crossing a day boundary, the semantics varies for different
structures. For structures that have a date component (i.e. for instances of
HasDate) the date is adjusted appropriately.
modL hours (+10) (LocalTime (fromGregorian 2012 05 23) (TimeOfDay 16 57 13))2012-05-24 02:57:13
modL seconds (subtract 1) (LocalTime (fromGregorian 2012 05 23) (TimeOfDay 0 0 0))2012-05-22 23:59:59
If there's no date, the time is simply wrapped around.
modL seconds (subtract 1) (TimeOfDay 0 0 0)23:59:59
timeZone is straightforward. Setting
TimeZone changes both
date, if present) in such a way that the new
zoned time corresponds to the same UTC time as the original zoned time.
Re-exports from Data.Time
The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.
Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.
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.
A local time together with a TimeZone.