-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A faster time library -- -- thyme is a performance-optimized rewrite of the excellent -- time library. -- -- See Data.Thyme.Docs for a full description. @package thyme @version 0.4 -- | Calendar months and day-of-months. module Data.Thyme.Calendar.MonthDay -- | Calendar month. January = 1 type Month = Int -- | Calendar day-of-month, starting from 1. type DayOfMonth = Int -- | A strict pair of a Month and a DayOfMonth. data MonthDay MonthDay :: {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> MonthDay [mdMonth] :: MonthDay -> {-# UNPACK #-} !Month [mdDay] :: MonthDay -> {-# UNPACK #-} !DayOfMonth _mdMonth :: Lens' MonthDay Month _mdDay :: Lens' MonthDay DayOfMonth -- | Predicated on whether or not it's a leap year, convert between an -- ordinal DayOfYear and the corresponding Month and -- DayOfMonth. -- --
--   > 60 ^. monthDay (isLeapYear 2015)
--   MonthDay {mdMonth = 3, mdDay = 1}
--   
-- --
--   > 60 ^. monthDay (isLeapYear 2016)
--   MonthDay {mdMonth = 2, mdDay = 29}
--   
-- --
--   > monthDay (isLeapYear 2016) # MonthDay 2 29
--   60
--   
-- --
--   > monthDay (isLeapYear 2015) # MonthDay 2 28
--   59
--   
-- -- Note that monthDay is an improper Iso, as the following -- example shows. To handle this case correctly, use -- monthDayValid. -- --
--   > monthDay (isLeapYear 2015) # MonthDay 2 29
--   59
--   
monthDay :: Bool -> Iso' DayOfYear MonthDay -- | Predicated on whether or not it's a leap year, convert a -- MonthDay to an ordinal DayOfYear. -- --
--   > monthDayValid (isLeapYear 2016) (MonthDay 2 29)
--   Just 60
--   
-- --
--   > monthDayValid (isLeapYear 2015) (MonthDay 2 29)
--   Nothing
--   
monthDayValid :: Bool -> MonthDay -> Maybe DayOfYear -- | Predicated on whether or not the year is a leap year, return the -- number of Days in the given Month. -- --
--   > monthLength (isLeapYear 2015) 2
--     28
--   
-- --
--   > monthLength (isLeapYear 2016) 2
--     29
--   
monthLength :: Bool -> Month -> Days -- | Predicated on whether or not it is a leap year, convert an ordinal -- DayOfYear to its corresponding Month and -- DayOfMonth. -- --
--   dayOfYearToMonthAndDay leap (view (monthDay leap) -> MonthDay m d) = (m, d)
--   
dayOfYearToMonthAndDay :: Bool -> DayOfYear -> (Month, DayOfMonth) -- | Predicated on whether or not it is a leap year, convert a Month -- and DayOfMonth to its corresponding ordinal DayOfYear. -- Does not validate the input. -- --
--   monthAndDayToDayOfYear leap m d = monthDay leap # MonthDay m d
--   
monthAndDayToDayOfYear :: Bool -> Month -> DayOfMonth -> DayOfYear -- | Predicated on whether or not it is a leap year, convert a Month -- and DayOfMonth to its corresponding ordinal DayOfYear. -- Returns Nothing for invalid input. -- --
--   monthAndDayToDayOfYearValid leap m d = monthDayValid leap (MonthDay m d)
--   
monthAndDayToDayOfYearValid :: Bool -> Month -> DayOfMonth -> Maybe DayOfYear -- | FOR INTERNAL USE ONLY. module Data.Thyme.Internal.Micro newtype Micro Micro :: Int64 -> Micro microQuotRem :: Micro -> Micro -> (Int64, Micro) microDivMod :: Micro -> Micro -> (Int64, Micro) instance Data.Vector.Unboxed.Base.Unbox Data.Thyme.Internal.Micro.Micro instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Data.Thyme.Internal.Micro.Micro instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Data.Thyme.Internal.Micro.Micro instance GHC.Show.Show Data.Thyme.Internal.Micro.Micro instance GHC.Read.Read Data.Thyme.Internal.Micro.Micro instance Data.AdditiveGroup.AdditiveGroup Data.Thyme.Internal.Micro.Micro instance Data.VectorSpace.VectorSpace Data.Thyme.Internal.Micro.Micro instance Data.Basis.HasBasis Data.Thyme.Internal.Micro.Micro instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Internal.Micro.Micro instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Internal.Micro.Micro instance System.Random.Random Data.Thyme.Internal.Micro.Micro instance GHC.Enum.Bounded Data.Thyme.Internal.Micro.Micro instance Control.DeepSeq.NFData Data.Thyme.Internal.Micro.Micro instance Data.Hashable.Class.Hashable Data.Thyme.Internal.Micro.Micro instance GHC.Ix.Ix Data.Thyme.Internal.Micro.Micro instance GHC.Enum.Enum Data.Thyme.Internal.Micro.Micro instance GHC.Generics.Generic Data.Thyme.Internal.Micro.Micro instance Data.Data.Data Data.Thyme.Internal.Micro.Micro instance GHC.Classes.Ord Data.Thyme.Internal.Micro.Micro instance GHC.Classes.Eq Data.Thyme.Internal.Micro.Micro -- | Vague textual descriptions of time durations. module Data.Thyme.Format.Human -- | Display DiffTime or NominalDiffTime in a human-readable -- form. humanTimeDiff :: TimeDiff d => d -> String -- | Display DiffTime or NominalDiffTime in a human-readable -- form. humanTimeDiffs :: TimeDiff d => d -> ShowS -- | Display one UTCTime relative to another, in a human-readable -- form. humanRelTime :: UTCTime -> UTCTime -> String -- | Display one UTCTime relative to another, in a human-readable -- form. humanRelTimes :: UTCTime -> UTCTime -> ShowS -- | POSIX time module Data.Thyme.Clock.POSIX -- | The nominal length of a POSIX day: 86400 SI seconds. posixDayLength :: NominalDiffTime -- | The nominal (ignoring leap seconds) time difference since midnight -- 1970-01-01, the Unix epoch. Equvialent to a normalised struct -- timeval. type POSIXTime = NominalDiffTime -- | Control.Lens.Iso between UTCTime and POSIXTime. -- --
--   > getPOSIXTime
--   1459515013.527711s
--   > review posixTime <$> getPOSIXTime
--   2016-01-01 12:50:45.588729 UTC
--   
posixTime :: Iso' UTCTime POSIXTime -- | Return the current system POSIX time via gettimeofday, -- or getSystemTimeAsFileTime on Windows. -- -- See also getCurrentTime, getZonedTime. getPOSIXTime :: IO POSIXTime -- | Construct a UTCTime from a POSIXTime. -- --
--   posixSecondsToUTCTime = review posixTime
--   posixSecondsToUTCTime t ≡ posixTime # t
--   
posixSecondsToUTCTime :: POSIXTime -> UTCTime -- | Convert a UTCTime to a POSIXTime. -- --
--   utcTimeToPOSIXSeconds = view posixTime
--   
utcTimeToPOSIXSeconds :: UTCTime -> POSIXTime -- | Types and functions for UTC and UT1. -- -- If you don't care about leap seconds, keep to UTCTime and -- NominalDiffTime for your clock calculations, and you'll be -- fine. -- -- Data.Thyme.Time provides Num, Real, -- Fractional and RealFrac instances for DiffTime -- and NominalDiffTime, but their use is discouraged. See -- Data.Thyme.Docs#spaces for details. -- -- Use fromSeconds and toSeconds to convert between -- DiffTime / NominalDiffTime and other numeric types; use -- fromSeconds' for literals to avoid type defaulting warnings. module Data.Thyme.Clock -- | Coördinated universal time (UTCTime) is the most -- commonly used standard for civil timekeeping. It is synchronised with -- TAI (AbsoluteTime) and both tick in increments of SI -- seconds, but UTC includes occasional leap-seconds to keep it close to -- UT1 (UniversalTime). -- --
--   > utcTime # UTCView (gregorian # YearMonthDay 2016 1 15) (timeOfDay # TimeOfDay 12 34 56.78)
--   2016-01-15 12:34:56.78 UTC
--   
--   > UTCTime (gregorian # YearMonthDay 2016 1 15) (timeOfDay # TimeOfDay 12 34 56.78)
--   2016-01-15 12:34:56.78 UTC
--   
--   > mkUTCTime 2016 1 15  12 34 56.78
--   2016-01-15 12:34:56.78 UTC
--   
-- -- UTCTime is an AffineSpace with NominalDiffTime as -- its Diff. See Data.Thyme.Docs#spaces for details. -- --
--   > let t0 = mkUTCTime 2016 1 15  23 59 0
--   > let t1 = mkUTCTime 2016 1 16  00  1 1
--   > let dt = t1 .-. t0
--   > dt
--   121s :: NominalDiffTime
--   
--   > t1 .+^ dt
--   2016-01-16 00:03:02 UTC
--   
--   > t1 .+^ 3 *^ dt
--   2016-01-16 00:07:04 UTC
--   
-- -- To decompose a UTCTime into a separate Day and -- time-of-day, use utcTime. To convert to a local time zone, see -- zonedTime or utcLocalTime. -- --

Notes

-- -- Internally UTCTime is just a 64-bit count of -- microseconds since the Modified Julian Day epoch, so -- (.+^), (.-.) et cetera ought to be -- fast. -- -- UTCTime cannot represent leap seconds. If leap seconds -- matter, use AbsoluteTime from Data.Thyme.Clock.TAI -- instead, along with absoluteTime' and UTCView for -- presentation. data UTCTime -- | Accessor for the calendar Day component of an UTCTime. -- --
--   utctDay = view _utctDay
--   
utctDay :: UTCTime -> Day -- | Accessor for the time-of-day DiffTime component of an -- UTCTime. -- --
--   utctDayTime = view _utctDayTime
--   
utctDayTime :: UTCTime -> DiffTime -- | Lens' for the calendar Day component of a -- UTCTime. _utctDay :: Lens' UTCTime Day -- | Lens' for the time-of-day DiffTime component of a -- UTCTime. _utctDayTime :: Lens' UTCTime DiffTime pattern UTCTime :: Day -> DiffTime -> UTCTime -- | Construct a UTCTime from a gregorian date and -- time-of-day. -- --
--   mkUTCTime yy mm dd h m s ≡ utcTime # UTCView
--       (gregorian # YearMonthDay yy mm dd)
--       (timeOfDay # TimeOfDay h m (fromSeconds s))
--   
mkUTCTime :: Year -> Month -> DayOfMonth -> Hour -> Minute -> Double -> UTCTime -- | View UTCTime as an UTCView, comprising a Day -- along with a DiffTime offset since midnight. -- -- This is an improper lens: utcvDayTime outside the range of -- [zeroV, posixDayLength) will carry over into -- utcvDay, with the expected behaviour. -- --
--   > view utcTime <$> getCurrentTime
--   UTCView {utcvDay = 2016-01-15, utcvDayTime = 49322.287688s}
--   
--   > utcTime # UTCView (gregorian # YearMonthDay 2016 1 15) (timeOfDay # TimeOfDay 12 34 56.78)
--   2016-01-15 12:34:56.78 UTC
--   
-- -- With {-# LANGUAGE ViewPatterns #-}, you can write: e.g. -- --
--   f :: UTCTime -> (Day, DiffTime)
--   f (view utcTime -> UTCView day dt) = (day, dt)
--   
utcTime :: Iso' UTCTime UTCView -- | Unpacked UTCTime, partly for compatibility with time. -- -- As of GHC 7.10, you can also use the UTCTime pattern synonym. data UTCView UTCView :: {-# UNPACK #-} !Day -> {-# UNPACK #-} !DiffTime -> UTCView -- | Calendar date. [utcvDay] :: UTCView -> {-# UNPACK #-} !Day -- | Time elapsed since midnight; 0utcvDayTime < -- 86401s. [utcvDayTime] :: UTCView -> {-# UNPACK #-} !DiffTime -- | Lens' for the calendar Day component of a -- UTCView. _utcvDay :: Lens' UTCView Day -- | Lens' for the time-of-day DiffTime component of a -- UTCView. _utcvDayTime :: Lens' UTCView DiffTime -- | The nominal interval between two UTCTimes, which does not take -- leap seconds into account. -- -- For example, the difference between 23:59:59 and -- 00:00:01 on the following day is always 2 seconds of -- NominalDiffTime, regardless of whether a leap-second took -- place. -- -- NominalDiffTime is an instance of AdditiveGroup as well -- as VectorSpace, with Rational as its Scalar. We -- do not provide Num, Real, Fractional nor -- RealFrac instances here. See Data.Thyme.Docs#spaces for -- details. -- --
--   > let d = fromSeconds' 2 :: NominalDiffTime
--   > d
--   2s
--   > d ^/ 3
--   0.666667s
--   
-- -- See also: UTCTime. data NominalDiffTime -- | Get the current UTC date and time from the local system clock. -- --
--   > getCurrentTime
--   2016-01-15 13:42:02.287688 UTC
--   
-- -- See also: getZonedTime, getPOSIXTime. getCurrentTime :: IO UTCTime -- | An interval or duration of time, as would be measured by a stopwatch. -- -- DiffTime is an instance of AdditiveGroup as well as -- VectorSpace, with Rational as its Scalar. We do -- not provide Num, Real, Fractional nor -- RealFrac instances here. See Data.Thyme.Docs#spaces for -- details. -- --
--   > fromSeconds' 100 :: DiffTime
--   100s
--   > fromSeconds' 100 ^+^ fromSeconds' 100 ^* 4
--   500s
--   > fromSeconds' 100 ^-^ fromSeconds' 100 ^/ 4
--   75s
--   
data DiffTime -- | Time intervals, encompassing both DiffTime and -- NominalDiffTime. -- --

Notes

-- -- Still affected by -- http://hackage.haskell.org/trac/ghc/ticket/7611? class (HasBasis t, Basis t ~ (), Scalar t ~ Rational) => TimeDiff t -- | Conversion between TimeDiff and Int64 microseconds. -- --
--   > (fromSeconds' 3 :: DiffTime) ^. microseconds
--   3000000
--   
--   > microseconds # 4000000 :: DiffTime
--   4s
--   
microseconds :: TimeDiff t => Iso' t Int64 -- | Convert a time interval to some Fractional type. toSeconds :: (TimeDiff t, Fractional n) => t -> n -- | Make a time interval from some Real type. -- -- Try to make sure n is one of Float, Double, -- Int, Int64 or Integer, for which rewrite -- RULES have been provided. fromSeconds :: (Real n, TimeDiff t) => n -> t -- | Type-restricted toSeconds to avoid constraint-defaulting -- warnings. toSeconds' :: TimeDiff t => t -> Rational -- | Type-restricted fromSeconds to avoid constraint-defaulting -- warnings. fromSeconds' :: TimeDiff t => Rational -> t -- | Conversion between TimeDiff and picoseconds. In the reverse -- direction, picoseconds are rounded to the nearest microsecond. picoseconds :: TimeDiff t => Iso' t Integer -- | The principal form of universal time, namely UT1. -- -- UT1 is defined by the rotation of the Earth around its axis relative -- to the Sun. The length of each UT1 day varies and is never exactly -- 86400 SI seconds, unlike UTC or TAI. -- -- The difference between UT1 and UTC is DUT1. data UniversalTime pattern UniversalTime :: Rational -> UniversalTime -- | Convert between UniversalTime and the fractional number of days -- since the Modified Julian Date epoch. modJulianDate :: Iso' UniversalTime Rational -- | Convert a UniversalTime to the fractional number of days since -- the Modified Julian Date epoch. -- --
--   getModJulianDate = view modJulianDate
--   
getModJulianDate :: UniversalTime -> Rational -- | Construct a UniversalTime from the fractional number of days -- since the Modified Julian Date epoch. -- --
--   mkModJulianDate = review modJulianDate
--   
mkModJulianDate :: Rational -> UniversalTime -- | Construct a DiffTime from some number of seconds. -- -- This is just fromSeconds with a more constrained type. -- --
--   secondsToDiffTime = fromSeconds
--   
secondsToDiffTime :: Int64 -> DiffTime -- | Construct a DiffTime from some number of picoseconds. The input -- will be rounded to the nearest microsecond. -- --
--   picosecondsToDiffTime a = microseconds # quot (a + signum a * 500000) 1000000
--   
picosecondsToDiffTime :: Integer -> DiffTime -- | Decompose a UTCTime into a UTCView. -- --
--   unUTCTime = view utcTime
--   
-- -- With {-# LANGUAGE ViewPatterns #-}, you can write: e.g. -- --
--   f :: UTCTime -> (Day, DiffTime)
--   f (unUTCTime -> UTCView day dt) = (day, dt)
--   
-- -- For GHC 7.8 or later, there is also the pattern synonym -- UTCTime. unUTCTime :: UTCTime -> UTCView -- | Add a duration to a point in time. -- --
--   addUTCTime = flip (.+^)
--   addUTCTime d t ≡ t .+^ d
--   
-- -- See also the AffineSpace instance for UTCTime. addUTCTime :: NominalDiffTime -> UTCTime -> UTCTime -- | The duration difference between two time points. -- --
--   diffUTCTime = (.-.)
--   diffUTCTime a b = a .-. b
--   
-- -- See also the AffineSpace instance for UTCTime. diffUTCTime :: UTCTime -> UTCTime -> NominalDiffTime -- | The number of microseconds in a DiffTime or -- NominalDiffTime. -- --
--   toMicroseconds :: DiffTime -> Int64
--   toMicroseconds :: NominalDiffTime -> Int64
--   toMicroseconds = view microseconds
--   toMicroseconds d ≡ d ^. microseconds
--   
toMicroseconds :: TimeDiff t => t -> Int64 -- | Construct a DiffTime or NominalDiffTime from a number of -- microseconds. -- --
--   fromMicroseconds :: Int64 -> DiffTime
--   fromMicroseconds :: Int64 -> NominalDiffTime
--   fromMicroseconds = review microseconds
--   fromMicroseconds n ≡ microseconds # n
--   
fromMicroseconds :: TimeDiff t => Int64 -> t -- | Calendar calculations. -- -- Note that UTCTime is not Y294K-compliant, and Bounded -- instances for the various calendar types reflect this fact. That said, -- the calendar calculations by themselves work perfectly fine for a -- wider range of dates, subject to the size of Int for your -- platform. module Data.Thyme.Calendar -- | A calendar-agnostic day, internally represented as a count of days -- since 1858-11-17, the Modified Julian Day (MJD) epoch. -- -- To convert a Day to the corresponding YearMonthDay in -- the Gregorian calendar, see gregorian. -- --
--   > gregorian # YearMonthDay 2016 3 1
--   2016-03-01
--   
-- -- Day is an instance of AffineSpace where Diff -- Day = Days, so arithmetic on Day and -- Days can be performed with the .-., .+^, and -- .-^ operators. -- --
--   > gregorian # YearMonthDay 2016 3 1  .-.  gregorian # YearMonthDay 2016 2 1
--   29
--   
-- --
--   > gregorian # YearMonthDay 2016 3 1 .-^ 1
--   2016-02-29
--   
-- -- Other ways of viewing a Day include ordinalDate, and -- weekDate. newtype Day ModifiedJulianDay :: Int -> Day [toModifiedJulianDay] :: Day -> Int -- | Convert between a Day and the corresponding count of days from -- 1858-11-17, the MJD epoch. -- --
--   modifiedJulianDay = iso toModifiedJulianDay ModifiedJulianDay
--   
-- --
--   > modifiedJulianDay # 0
--   1858-11-17
--   > gregorian # YearMonthDay 2016 3 1 & modifiedJulianDay %~ subtract 1
--   2016-02-29
--   
modifiedJulianDay :: Iso' Day Int -- | Calendar year. type Year = Int -- | Calendar month. January = 1 type Month = Int -- | Calendar day-of-month, starting from 1. type DayOfMonth = Int -- | A strict triple of a Year, a Day, and a Month. data YearMonthDay YearMonthDay :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !Month -> {-# UNPACK #-} !DayOfMonth -> YearMonthDay [ymdYear] :: YearMonthDay -> {-# UNPACK #-} !Year [ymdMonth] :: YearMonthDay -> {-# UNPACK #-} !Month [ymdDay] :: YearMonthDay -> {-# UNPACK #-} !DayOfMonth _ymdYear :: Lens' YearMonthDay Year _ymdMonth :: Lens' YearMonthDay Month _ymdDay :: Lens' YearMonthDay DayOfMonth -- | A duration/count of years. type Years = Int -- | A duration/count of months. type Months = Int -- | A duration/count of days. type Days = Int -- | Is it a leap year according to the Gregorian calendar? isLeapYear :: Year -> Bool -- | Conversion between a Gregorian OrdinalDate and the -- corresponding YearMonthDay. -- --
--   > OrdinalDate 2016 32 ^. yearMonthDay
--   YearMonthDay {ymdYear = 2016, ymdMonth = 2, ymdDay = 1}
--   
-- --
--   > yearMonthDay # YearMonthDay 2016 2 1
--   OrdinalDate {odYear = 2016, odDay = 32}
--   
yearMonthDay :: Iso' OrdinalDate YearMonthDay -- | Conversion between a Day and its YearMonthDay. -- --
--   gregorian = ordinalDate . yearMonthDay
--   
-- --
--   > ModifiedJulianDay 0 ^. gregorian
--   YearMonthDay {ymdYear = 1858, ymdMonth = 11, ymdDay = 17}
--   
-- --
--   > gregorian # YearMonthDay 1858 11 17
--   1858-11-17
--   
gregorian :: Iso' Day YearMonthDay -- | Conversion between a YearMonthDay and the corresponding -- Day. Returns Nothing for invalid input. -- --
--   > gregorianValid (YearMonthDay 2015 2 28)
--   Just 2015-02-28
--   
-- --
--   > gregorianValid (YearMonthDay 2015 2 29)
--   Nothing
--   
gregorianValid :: YearMonthDay -> Maybe Day -- | Shows a Day in ISO 8601 YYYY-MM-DD format. -- -- See Data.Thyme.Format for other possibilities. showGregorian :: Day -> String -- | The number of days in a given month in the Gregorian calendar. -- --
--   > gregorianMonthLength 2005 2
--   28
--   
gregorianMonthLength :: Year -> Month -> Days -- | Add months, with days past the last day of the month clipped to the -- last day. -- -- See also addGregorianMonthsClip. -- --
--   > gregorianMonthsClip 1 $ YearMonthDay 2005 1 30
--   YearMonthDay {ymdYear = 2005, ymdMonth = 2, ymdDay = 28}
--   
gregorianMonthsClip :: Months -> YearMonthDay -> YearMonthDay -- | Add months, with days past the last day of the month rolling over to -- the next month. -- -- See also addGregorianMonthsRollover. -- --
--   > gregorianMonthsRollover 1 $ YearMonthDay 2005 1 30
--   YearMonthDay {ymdYear = 2005, ymdMonth = 3, ymdDay = 2}
--   
gregorianMonthsRollover :: Months -> YearMonthDay -> YearMonthDay -- | Add years, matching month and day, with February 29th clipped -- to the 28th if necessary. -- -- See also addGregorianYearsClip. -- --
--   > gregorianYearsClip 2 $ YearMonthDay 2004 2 29
--   YearMonthDay {ymdYear = 2006, ymdMonth = 2, ymdDay = 28}
--   
gregorianYearsClip :: Years -> YearMonthDay -> YearMonthDay -- | Add years, matching month and day, with February 29th rolled -- over to March 1st if necessary. -- -- See also addGregorianYearsRollover. -- --
--   > gregorianYearsRollover 2 $ YearMonthDay 2004 2 29
--   YearMonthDay {ymdYear = 2006, ymdMonth = 3, ymdDay = 1}
--   
gregorianYearsRollover :: Years -> YearMonthDay -> YearMonthDay -- | Add some Days to a calendar Day to get a new Day. -- --
--   addDays = flip (.+^)
--   addDays n d ≡ d .+^ n
--   
-- -- See also the AffineSpace instance for Day. addDays :: Days -> Day -> Day -- | Subtract two calendar Days for the difference in Days. -- --
--   diffDays = (.-.)
--   diffDays a b = a .-. b
--   
-- -- See also the AffineSpace instance for Day. diffDays :: Day -> Day -> Days -- | Convert a Day to its Gregorian Year, Month, and -- DayOfMonth. -- --
--   toGregorian (view gregorian -> YearMonthDay y m d) = (y, m, d)
--   
toGregorian :: Day -> (Year, Month, DayOfMonth) -- | Construct a Day from a Gregorian calendar date. Does not -- validate the input. -- --
--   fromGregorian y m d = gregorian # YearMonthDay y m d
--   
fromGregorian :: Year -> Month -> DayOfMonth -> Day -- | Construct a Day from a Gregorian calendar date. Returns -- Nothing for invalid input. -- --
--   fromGregorianValid y m d = gregorianValid (YearMonthDay y m d)
--   
fromGregorianValid :: Year -> Month -> DayOfMonth -> Maybe Day -- | Add some number of Months to the given Day; if the -- original DayOfMonth exceeds that of the new Month, it -- will be clipped to the last day of the new Month. -- --
--   addGregorianMonthsClip n = gregorian %~ gregorianMonthsClip n
--   
addGregorianMonthsClip :: Months -> Day -> Day -- | Add some number of Months to the given Day; if the -- original DayOfMonth exceeds that of the new Month, it -- will be rolled over into the following Month. -- --
--   addGregorianMonthsRollover n = gregorian %~ gregorianMonthsRollover n
--   
addGregorianMonthsRollover :: Months -> Day -> Day -- | Add some number of Years to the given Day, with -- February 29th clipped to February 28th if necessary. -- --
--   addGregorianYearsClip n = gregorian %~ gregorianYearsClip n
--   
addGregorianYearsClip :: Years -> Day -> Day -- | Add some number of Years to the given Day, with -- February 29th rolled over to March 1st if necessary. -- --
--   addGregorianYearsRollover n = gregorian %~ gregorianYearsRollover n
--   
addGregorianYearsRollover :: Years -> Day -> Day instance GHC.Enum.Bounded Data.Thyme.Calendar.Internal.Day instance GHC.Enum.Bounded Data.Thyme.Calendar.Internal.YearMonthDay instance System.Random.Random Data.Thyme.Calendar.Internal.Day instance System.Random.Random Data.Thyme.Calendar.Internal.YearMonthDay instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.Internal.Day instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.Internal.YearMonthDay instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Calendar.Internal.YearMonthDay -- | Calendar date reckoned by year, month-of-year, and n-th day-of-week. module Data.Thyme.Calendar.WeekdayOfMonth -- | Calendar year. type Year = Int -- | Calendar month. January = 1 type Month = Int -- | Day of the week. -- -- type DayOfWeek = Int pattern MV_WeekdayOfMonth :: () => MVector s Int -> MVector s WeekdayOfMonth pattern V_WeekdayOfMonth :: () => Vector Int -> Vector WeekdayOfMonth -- | Calendar date with year, month-of-year, and n-th day-of-week. data WeekdayOfMonth WeekdayOfMonth :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !Month -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !DayOfWeek -> WeekdayOfMonth -- | Calendar year. [womYear] :: WeekdayOfMonth -> {-# UNPACK #-} !Year -- | Month of year. [womMonth] :: WeekdayOfMonth -> {-# UNPACK #-} !Month -- | N-th DayOfWeek. Range ±1–5; negative means the -- N-th last DayOfWeek of the month. [womNth] :: WeekdayOfMonth -> {-# UNPACK #-} !Int -- | Day of week. 1 = Monday, 7 = Sunday, like ISO 8601 -- WeekDate. [womDayOfWeek] :: WeekdayOfMonth -> {-# UNPACK #-} !DayOfWeek _womYear :: Lens' WeekdayOfMonth Year _womMonth :: Lens' WeekdayOfMonth Month _womNth :: Lens' WeekdayOfMonth Int _womDayOfWeek :: Lens' WeekdayOfMonth DayOfWeek -- | Conversion between a Day and and WeekdayOfMonth. -- -- This is a proper Iso if and only if all of the -- WeekdayOfMonth fields are valid and positive. -- -- For example, the last Monday in January 2016 is also the -- fourth Monday: -- --
--   > weekdayOfMonth # WeekdayOfMonth 2016 1 (-1) 1
--   2016-01-25
--   > YearMonthDay 2016 01 25 ^. from gregorian . weekdayOfMonth
--   WeekdayOfMonth {womYear = 2016, womMonth = 1, womNth = 4, womDayOfWeek = 1}
--   
weekdayOfMonth :: Iso' Day WeekdayOfMonth -- | Convert a WeekdayOfMonth to a Day. Returns -- Nothing for invalid input. -- -- For example, the third Sunday of January 2016 is -- 2016-01-27, but there is no fifth Monday in January -- 2016. -- --
--   > weekdayOfMonthValid (WeekdayOfMonth 2016 1 3 7)
--   Just 2016-01-17
--   > weekdayOfMonthValid (WeekdayOfMonth 2016 1 5 1)
--   Nothing
--   
weekdayOfMonthValid :: WeekdayOfMonth -> Maybe Day instance Data.Vector.Unboxed.Base.Unbox Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Data.Hashable.Class.Hashable Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Control.DeepSeq.NFData Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance GHC.Enum.Bounded Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance System.Random.Random Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance GHC.Show.Show Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance GHC.Generics.Generic Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance Data.Data.Data Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance GHC.Classes.Ord Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth instance GHC.Classes.Eq Data.Thyme.Calendar.WeekdayOfMonth.WeekdayOfMonth -- | ISO 8601 Ordinal Date format module Data.Thyme.Calendar.OrdinalDate -- | Calendar year. type Year = Int -- | Is it a leap year according to the Gregorian calendar? isLeapYear :: Year -> Bool -- | The day of the year, with 1 = January 1st. type DayOfYear = Int -- | An ISO 8601 ordinal date. data OrdinalDate OrdinalDate :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !DayOfYear -> OrdinalDate [odYear] :: OrdinalDate -> {-# UNPACK #-} !Year [odDay] :: OrdinalDate -> {-# UNPACK #-} !DayOfYear _odYear :: Lens' OrdinalDate Year _odDay :: Lens' OrdinalDate DayOfYear -- | Conversion between the MJD Day and OrdinalDate. -- --
--   > ordinalDate # OrdinalDate 2016 32
--   2016-02-01
--   
-- --
--   > toModifiedJulianDay $ ordinalDate # OrdinalDate 2016 32
--   57419
--   
-- --
--   > ModifiedJulianDay 57419 ^. ordinalDate
--   OrdinalDate {odYear = 2016, odDay = 32}
--   
ordinalDate :: Iso' Day OrdinalDate -- | Convert an OrdinalDate to a Day, or Nothing for -- invalid input. -- --
--   > ordinalDateValid (OrdinalDate 2015 365)
--   Just 2015-12-31
--   
--   > ordinalDateValid (OrdinalDate 2015 366)
--   Nothing
--   
--   > ordinalDateValid (OrdinalDate 2016 366)
--   Just 2016-12-31
--   
ordinalDateValid :: OrdinalDate -> Maybe Day -- | Convert a Day to its Gregorian Year and -- DayOfYear. -- --
--   toOrdinalDate (view ordinalDate -> OrdinalDate y d) = (y, d)
--   
toOrdinalDate :: Day -> (Year, DayOfYear) -- | Convert a Gregorian Year and DayOfYear to a Day. -- Does not validate the input. -- --
--   fromOrdinalDate y d = ordinalDate # OrdinalDate y d
--   
fromOrdinalDate :: Year -> DayOfYear -> Day -- | Converts a Gregorian Year and DayOfYear to a Day. -- Returns Nothing on invalid input. -- --
--   fromOrdinalDateValid y d = ordinalDateValid (OrdinalDate y d)
--   
fromOrdinalDateValid :: Year -> DayOfYear -> Maybe Day -- | Converts a Day to its Sunday-starting week date. -- -- The first Sunday of the year belongs to 1 ∷ -- WeekOfYear; earlier days in the same year are week -- 0. This corresponds to "%U" for formatTime. -- -- Sunday is 0 ∷ DayOfWeek, Saturday is -- 6. This corresponds to "%w" for formatTime. -- --
--   sundayStartWeek (view sundayWeek -> SundayWeek y w d) = (y, w, d)
--   
sundayStartWeek :: Day -> (Year, WeekOfYear, DayOfWeek) -- | Converts a Sunday-starting week date to the corresponding -- Day; the inverse of sundayStartWeek. Does not validate -- the input. -- --
--   fromSundayStartWeek y w d = sundayWeek # SundayWeek y w d
--   
fromSundayStartWeek :: Year -> WeekOfYear -> DayOfWeek -> Day -- | Converts a Sunday-starting week date to the corresponding -- Day; the inverse of sundayStartWeek. Returns -- Nothing for invalid input. -- --
--   fromSundayStartWeekValid y w d = sundayWeekValid (SundayWeek y w d)
--   
fromSundayStartWeekValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day -- | Converts a Day to its Monday-starting week date. -- -- The first Monday of the year belongs to 1 ∷ -- WeekOfYear; earlier days in the same year are week -- 0. This corresponds to "%W" for formatTime. -- -- Monday is 1 ∷ DayOfWeek, Sunday is -- 7. This corresponds to "%u" for formatTime. -- --
--   mondayStartWeek (view mondayWeek -> MondayWeek y w d) = (y, w, d)
--   
mondayStartWeek :: Day -> (Year, WeekOfYear, DayOfWeek) -- | Converts a Monday-starting week date to the corresponding -- Day; the inverse of mondayStartWeek. Does not validate -- the input. -- --
--   fromMondayStartWeek y w d = mondayWeek # MondayWeek y w d
--   
fromMondayStartWeek :: Year -> WeekOfYear -> DayOfWeek -> Day -- | Converts a Monday-starting week date to the corresponding -- Day; the inverse of mondayStartWeek. Returns -- Nothing for invalid input. -- --
--   fromMondayStartWeekValid y w d = mondayWeekValid (MondayWeek y w d)
--   
fromMondayStartWeekValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day instance GHC.Enum.Bounded Data.Thyme.Calendar.Internal.OrdinalDate instance System.Random.Random Data.Thyme.Calendar.Internal.OrdinalDate instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.Internal.OrdinalDate instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Calendar.Internal.OrdinalDate -- | Various Week Date formats module Data.Thyme.Calendar.WeekDate -- | Calendar year. type Year = Int -- | Week of the year. -- -- Meaning of values depends on context; see wdWeek, -- swWeek, mwWeek. type WeekOfYear = Int -- | Day of the week. -- -- type DayOfWeek = Int -- | ISO 8601 Week Date. -- -- Note that week 01 is defined as the week with the first -- Thursday, thus wdYear may differ from the Gregorian year -- between December 29th and January 3rd. data WeekDate WeekDate :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !WeekOfYear -> {-# UNPACK #-} !DayOfWeek -> WeekDate [wdYear] :: WeekDate -> {-# UNPACK #-} !Year -- | Numbered 01 to 53. Days before week 01 are -- considered to belong to the previous year. [wdWeek] :: WeekDate -> {-# UNPACK #-} !WeekOfYear -- | 1 = Monday7 = Sunday. [wdDay] :: WeekDate -> {-# UNPACK #-} !DayOfWeek _wdYear :: Lens' WeekDate Year _wdWeek :: Lens' WeekDate WeekOfYear _wdDay :: Lens' WeekDate DayOfWeek -- | Convert between a Day and an ISO 8601 WeekDate. -- --
--   > YearMonthDay 2016 1 1 ^. from gregorian . weekDate
--   WeekDate {wdYear = 2015, wdWeek = 53, wdDay = 5}
--   
weekDate :: Iso' Day WeekDate -- | Convert a WeekDate to a Day, or Nothing for -- invalid WeekDate. weekDateValid :: WeekDate -> Maybe Day -- | Shows a Day using the yyyy-Www-d ISO 8601 Week Date -- format. -- --
--   > showWeekDate (gregorian # YearMonthDay 2006 11 15)
--   "2006-W46-3"
--   
showWeekDate :: Day -> String -- | Week-based calendar date with the first Sunday of the year as -- the first day of week 01. This corresponds to %U and -- %w of strftime(3). -- -- The final week of a given year and week 00 of the next both -- refer to the same week. data SundayWeek SundayWeek :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !WeekOfYear -> {-# UNPACK #-} !DayOfWeek -> SundayWeek -- | Coincides with that of gregorian. [swYear] :: SundayWeek -> {-# UNPACK #-} !Year -- | Weeks numbered from 00 to 53, starting with the first -- Sunday of the year as the first day of week 01. [swWeek] :: SundayWeek -> {-# UNPACK #-} !WeekOfYear -- | 0 = Sunday. [swDay] :: SundayWeek -> {-# UNPACK #-} !DayOfWeek _swYear :: Lens' SundayWeek Year _swWeek :: Lens' SundayWeek WeekOfYear _swDay :: Lens' SundayWeek DayOfWeek -- | Conversion between Day and SundayWeek. -- --
--   > YearMonthDay 2016 1 3 ^. from gregorian . sundayWeek
--   SundayWeek {swYear = 2016, swWeek = 1, swDay = 0}
--   
sundayWeek :: Iso' Day SundayWeek -- | Convert a SundayWeek to a Day, or Nothing for -- invalid SundayWeek. sundayWeekValid :: SundayWeek -> Maybe Day -- | Week-based calendar date with the first Monday of the year as -- the first day of week 01. This corresponds to %W and -- %u of strftime(3). -- -- The final week of a given year and week 00 of the next both -- refer to the same week. data MondayWeek MondayWeek :: {-# UNPACK #-} !Year -> {-# UNPACK #-} !WeekOfYear -> {-# UNPACK #-} !DayOfWeek -> MondayWeek -- | Coincides with that of gregorian. [mwYear] :: MondayWeek -> {-# UNPACK #-} !Year -- | Weeks numbered from 00 to 53, starting with the first -- Monday of the year as the first day of week 01. [mwWeek] :: MondayWeek -> {-# UNPACK #-} !WeekOfYear -- | 7 = Sunday. [mwDay] :: MondayWeek -> {-# UNPACK #-} !DayOfWeek _mwYear :: Lens' MondayWeek Year _mwWeek :: Lens' MondayWeek WeekOfYear _mwDay :: Lens' MondayWeek DayOfWeek -- | Conversion between Day and MondayWeek. -- --
--   > YearMonthDay 2016 1 3 ^. from gregorian . mondayWeek
--   MondayWeek {mwYear = 2016, mwWeek = 0, mwDay = 7}
--   
mondayWeek :: Iso' Day MondayWeek -- | Convert a MondayWeek to a Day, or Nothing for -- invalid MondayWeek. mondayWeekValid :: MondayWeek -> Maybe Day -- | Converts a Day to an ISO week date. -- --
--   toWeekDate (view weekDate -> WeekDate y w d) = (y, w, d)
--   
toWeekDate :: Day -> (Year, WeekOfYear, DayOfWeek) -- | Converts an ISO week date to a Day. Does not validate -- the input. -- --
--   fromWeekDate y w d = weekDate # WeekDate y w d
--   
fromWeekDate :: Year -> WeekOfYear -> DayOfWeek -> Day -- | Converts an ISO week date to a Day. Returns -- Nothing for invalid input. -- --
--   fromWeekDateValid y w d = weekDateValid (WeekDate y w d)
--   
fromWeekDateValid :: Year -> WeekOfYear -> DayOfWeek -> Maybe Day instance GHC.Enum.Bounded Data.Thyme.Calendar.Internal.WeekDate instance GHC.Enum.Bounded Data.Thyme.Calendar.Internal.SundayWeek instance GHC.Enum.Bounded Data.Thyme.Calendar.Internal.MondayWeek instance System.Random.Random Data.Thyme.Calendar.Internal.WeekDate instance System.Random.Random Data.Thyme.Calendar.Internal.SundayWeek instance System.Random.Random Data.Thyme.Calendar.Internal.MondayWeek instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.Internal.WeekDate instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.Internal.SundayWeek instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Calendar.Internal.MondayWeek instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Calendar.Internal.WeekDate instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Calendar.Internal.SundayWeek instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Calendar.Internal.MondayWeek -- | Local time and time zones. module Data.Thyme.LocalTime -- | Hour time-of-day. type Hour = Int -- | Minute time-of-day. type Minute = Int pattern MV_TimeOfDay :: () => MVector s Int64 -> MVector s TimeOfDay pattern MV_LocalTime :: () => MVector s (Day, TimeOfDay) -> MVector s LocalTime pattern V_TimeOfDay :: () => Vector Int64 -> Vector TimeOfDay pattern V_LocalTime :: () => Vector (Day, TimeOfDay) -> Vector LocalTime -- | Time of day in hour, minute, second. data TimeOfDay TimeOfDay :: {-# UNPACK #-} !Hour -> {-# UNPACK #-} !Minute -> {-# UNPACK #-} !DiffTime -> TimeOfDay [todHour] :: TimeOfDay -> {-# UNPACK #-} !Hour [todMin] :: TimeOfDay -> {-# UNPACK #-} !Minute -- | Second. [todSec] :: TimeOfDay -> {-# UNPACK #-} !DiffTime -- | Description of one time zone. -- -- A TimeZone is a whole number of minutes offset from UTC, -- together with a name and a ‘summer time’ flag. data TimeZone TimeZone :: {-# UNPACK #-} !Minutes -> !Bool -> String -> TimeZone -- | The number of minutes offset from UTC. [timeZoneMinutes] :: TimeZone -> {-# UNPACK #-} !Minutes -- | Is this a summer-only (i.e. daylight savings) time zone? [timeZoneSummerOnly] :: TimeZone -> !Bool -- | The name of the zone, typically a three- or four-letter acronym. [timeZoneName] :: TimeZone -> String -- | Minutes duration. type Minutes = Int -- | Hours duration. type Hours = Int _timeZoneMinutes :: Lens' TimeZone Minutes _timeZoneSummerOnly :: Lens' TimeZone Bool _timeZoneName :: Lens' TimeZone String -- | Text representing the offset of this timezone, e.g. "-0800" or "+0400" -- (like %z in formatTime) timeZoneOffsetString :: TimeZone -> String -- | Text representing the offset of this timezone in ISO 8601 style, e.g. -- "-08:00" or "+04:00" (like %N in formatTime) timeZoneOffsetStringColon :: TimeZone -> String -- | Create a nameless non-summer timezone for this number of minutes minutesToTimeZone :: Minutes -> TimeZone -- | Create a nameless non-summer timezone for this number of hours hoursToTimeZone :: Hours -> TimeZone -- | The UTC (Zulu) time zone. -- --
--   utc = TimeZone 0 False "UTC"
--   
utc :: TimeZone -- | Get the local time zone at the given time, varying as per summer time -- adjustments. -- -- Performed by localtime_r or a similar call. getTimeZone :: UTCTime -> IO TimeZone -- | Get the current local time zone. -- --
--   getCurrentTimeZone = getCurrentTime >>= getTimeZone
--   
-- --
--   > getCurrentTimeZone
--   JST
--   
getCurrentTimeZone :: IO TimeZone _todHour :: Lens' TimeOfDay Hour _todMin :: Lens' TimeOfDay Minute _todSec :: Lens' TimeOfDay DiffTime -- | Local calendar date and time-of-day. -- -- This type is appropriate for inputting from and outputting to the -- outside world. -- -- To actually perform logic and arithmetic on local date-times, a -- LocalTime should first be converted to a UTCTime by the -- utcLocalTime Iso. -- -- See also: ZonedTime. data LocalTime LocalTime :: {-# UNPACK #-} !Day -> {-# UNPACK #-} !TimeOfDay -> LocalTime -- | Local calendar date. [localDay] :: LocalTime -> {-# UNPACK #-} !Day -- | Local time-of-day. [localTimeOfDay] :: LocalTime -> {-# UNPACK #-} !TimeOfDay -- | The maximum possible length of a minute. Always 60s, except at -- 23:59 due to leap seconds. -- --
--   minuteLength 23 59 = fromSeconds' 61
--   minuteLength _  _  = fromSeconds' 60
--   
minuteLength :: Hour -> Minute -> DiffTime -- | Hour zero, midnight. -- --
--   midnight = TimeOfDay 0 0 zeroV
--   
midnight :: TimeOfDay -- | Hour twelve, noon. -- --
--   midday = TimeOfDay 12 0 zeroV
--   
midday :: TimeOfDay -- | Construct a TimeOfDay from the hour, minute, and second. -- -- Returns Nothing if these constraints are not satisfied: -- -- makeTimeOfDayValid :: Hour -> Minute -> DiffTime -> Maybe TimeOfDay -- | Conversion between DiffTime and TimeOfDay. -- --
--   > fromSeconds' 100 ^. timeOfDay
--   00:01:40
--   
--   > timeOfDay # TimeOfDay 0 1 40
--   100s
--   
timeOfDay :: Iso' DiffTime TimeOfDay -- | Add some minutes to a TimeOfDay; the result includes a day -- adjustment. -- --
--   > addMinutes 10 (TimeOfDay 23 55 0)
--   (1,00:05:00)
--   
addMinutes :: Minutes -> TimeOfDay -> (Days, TimeOfDay) -- | Conversion between TimeOfDay and the fraction of a day. -- --
--   > TimeOfDay 6 0 0 ^. dayFraction
--   1 % 4
--   > TimeOfDay 8 0 0 ^. dayFraction
--   1 % 3
--   
--   > dayFraction # (1 / 4)
--   06:00:00
--   > dayFraction # (1 / 3)
--   08:00:00
--   
dayFraction :: Iso' TimeOfDay Rational _localDay :: Lens' LocalTime Day _localTimeOfDay :: Lens' LocalTime TimeOfDay -- | A LocalTime and its TimeZone. -- -- This type is appropriate for inputting from and outputting to the -- outside world. -- -- To actually perform logic and arithmetic on local date-times, a -- ZonedTime should first be converted to a UTCTime by the -- zonedTime Iso. data ZonedTime ZonedTime :: {-# UNPACK #-} !LocalTime -> !TimeZone -> ZonedTime [zonedTimeToLocalTime] :: ZonedTime -> {-# UNPACK #-} !LocalTime [zonedTimeZone] :: ZonedTime -> !TimeZone -- | Conversion between UTCTime and LocalTime. -- --
--   > tz <- getCurrentTimeZone
--   
--   > timeZoneName tz
--   "JST"
--   
--   > timeZoneOffsetString tz
--   "+0900"
--   
--   > now <- getCurrentTime
--   > now
--   2016-04-23 02:00:00.000000 UTC
--   
--   > let local = now ^. utcLocalTime tz
--   > local
--   2016-04-23 11:00:00.000000
--   
--   > utcLocalTime tz # local
--   2016-04-23 02:00:00.000000 UTC
--   
-- -- See also: zonedTime. utcLocalTime :: TimeZone -> Iso' UTCTime LocalTime -- | Conversion between UniversalTime and LocalTime. ut1LocalTime :: Rational -> Iso' UniversalTime LocalTime _zonedTimeToLocalTime :: Lens' ZonedTime LocalTime _zonedTimeZone :: Lens' ZonedTime TimeZone -- | Conversion between (TimeZone, UTCTime) and -- ZonedTime. -- --
--   > now <- getZonedTime
--   > now
--   2016-04-04 16:00:00.000000 JST
--   
--   > zonedTime # now
--   (JST,2016-04-04 07:00:00.000000 UTC)
--   
--   > (zonedTime # now) ^. zonedTime
--   2016-04-04 16:00:00.000000 JST
--   
-- -- See also: utcLocalTime. zonedTime :: Iso' (TimeZone, UTCTime) ZonedTime -- | Get the current local date, time, and time zone. -- --
--   > getZonedTime
--   2016-04-23 11:57:22.516064 JST
--   
-- -- See also: getCurrentTime, getPOSIXTime. getZonedTime :: IO ZonedTime -- | Convert a UTCTime to a ZonedTime according to the local -- time zone returned by getTimeZone. -- -- See also: zonedTime. utcToLocalZonedTime :: UTCTime -> IO ZonedTime -- | Convert a UTC TimeOfDay to a TimeOfDay in some timezone, -- together with a day adjustment. -- --
--   utcToLocalTimeOfDay = addMinutes . timeZoneMinutes
--   
utcToLocalTimeOfDay :: TimeZone -> TimeOfDay -> (Days, TimeOfDay) -- | Convert a TimeOfDay in some timezone to a UTC TimeOfDay, -- together with a day adjustment. -- --
--   localToUTCTimeOfDay = addMinutes . negate . timeZoneMinutes
--   
localToUTCTimeOfDay :: TimeZone -> TimeOfDay -> (Days, TimeOfDay) -- | Convert a DiffTime of the duration since midnight to a -- TimeOfDay. Durations exceeding 24 hours will be treated as -- leap-seconds. -- --
--   timeToTimeOfDay = view timeOfDay
--   timeToTimeOfDay d ≡ d ^. timeOfDay
--   
timeToTimeOfDay :: DiffTime -> TimeOfDay -- | Convert a TimeOfDay to a DiffTime of the duration since -- midnight. TimeOfDay greater than 24 hours will be treated as -- leap-seconds. -- --
--   timeOfDayToTime = review timeOfDay
--   timeOfDayToTime tod ≡ timeOfDay # tod
--   
timeOfDayToTime :: TimeOfDay -> DiffTime -- | Convert a fraction of a day since midnight to a TimeOfDay. -- --
--   dayFractionToTimeOfDay = review dayFraction
--   
dayFractionToTimeOfDay :: Rational -> TimeOfDay -- | Convert a TimeOfDay to a fraction of a day since midnight. -- --
--   timeOfDayToDayFraction = view dayFraction
--   
timeOfDayToDayFraction :: TimeOfDay -> Rational -- | Convert a UTCTime to a LocalTime in the given -- TimeZone. -- --
--   utcToLocalTime = view . utcLocalTime
--   
utcToLocalTime :: TimeZone -> UTCTime -> LocalTime -- | Convert a LocalTime in the given TimeZone to a -- UTCTime. -- --
--   localTimeToUTC = review . utcLocalTime
--   
localTimeToUTC :: TimeZone -> LocalTime -> UTCTime -- | Convert a UniversalTime to a LocalTime at the given -- medidian in degrees East. -- --
--   ut1ToLocalTime = view . ut1LocalTime
--   
ut1ToLocalTime :: Rational -> UniversalTime -> LocalTime -- | Convert a LocalTime at the given meridian in degrees East to a -- UniversalTime. -- --
--   localTimeToUT1 = review . ut1LocalTime
--   
localTimeToUT1 :: Rational -> LocalTime -> UniversalTime -- | Convert a UTCTime and the given TimeZone into a -- ZonedTime. -- --
--   utcToZonedTime z t = view zonedTime (z, t)
--   
utcToZonedTime :: TimeZone -> UTCTime -> ZonedTime -- | Converts a ZonedTime to a UTCTime. -- --
--   zonedTimeToUTC = snd . review zonedTime
--   
zonedTimeToUTC :: ZonedTime -> UTCTime instance GHC.Generics.Generic Data.Thyme.LocalTime.ZonedTime instance Data.Data.Data Data.Thyme.LocalTime.ZonedTime instance GHC.Classes.Ord Data.Thyme.LocalTime.ZonedTime instance GHC.Classes.Eq Data.Thyme.LocalTime.ZonedTime instance Data.Hashable.Class.Hashable Data.Thyme.LocalTime.ZonedTime instance Control.DeepSeq.NFData Data.Thyme.LocalTime.ZonedTime instance GHC.Enum.Bounded Data.Thyme.LocalTime.ZonedTime instance System.Random.Random Data.Thyme.LocalTime.ZonedTime instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.LocalTime.ZonedTime instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.LocalTime.ZonedTime instance GHC.Show.Show Data.Thyme.LocalTime.ZonedTime instance Data.Vector.Unboxed.Base.Unbox Data.Thyme.LocalTime.LocalTime instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Data.Thyme.LocalTime.LocalTime instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Data.Thyme.LocalTime.LocalTime instance Data.Hashable.Class.Hashable Data.Thyme.LocalTime.LocalTime instance Control.DeepSeq.NFData Data.Thyme.LocalTime.LocalTime instance GHC.Show.Show Data.Thyme.LocalTime.LocalTime instance GHC.Enum.Bounded Data.Thyme.LocalTime.LocalTime instance System.Random.Random Data.Thyme.LocalTime.LocalTime instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.LocalTime.LocalTime instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.LocalTime.LocalTime instance GHC.Show.Show Data.Thyme.Clock.Internal.UTCTime instance GHC.Generics.Generic Data.Thyme.LocalTime.LocalTime instance Data.Data.Data Data.Thyme.LocalTime.LocalTime instance GHC.Classes.Ord Data.Thyme.LocalTime.LocalTime instance GHC.Classes.Eq Data.Thyme.LocalTime.LocalTime instance Data.Vector.Unboxed.Base.Unbox Data.Thyme.LocalTime.TimeOfDay instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Data.Thyme.LocalTime.TimeOfDay instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Data.Thyme.LocalTime.TimeOfDay instance Data.Hashable.Class.Hashable Data.Thyme.LocalTime.TimeOfDay instance Control.DeepSeq.NFData Data.Thyme.LocalTime.TimeOfDay instance GHC.Show.Show Data.Thyme.LocalTime.TimeOfDay instance GHC.Enum.Bounded Data.Thyme.LocalTime.TimeOfDay instance System.Random.Random Data.Thyme.LocalTime.TimeOfDay instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.LocalTime.TimeOfDay instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.LocalTime.TimeOfDay instance GHC.Generics.Generic Data.Thyme.LocalTime.TimeZone instance Data.Data.Data Data.Thyme.LocalTime.TimeZone instance GHC.Classes.Ord Data.Thyme.LocalTime.TimeZone instance GHC.Classes.Eq Data.Thyme.LocalTime.TimeZone instance GHC.Generics.Generic Data.Thyme.LocalTime.TimeOfDay instance Data.Data.Data Data.Thyme.LocalTime.TimeOfDay instance GHC.Classes.Ord Data.Thyme.LocalTime.TimeOfDay instance GHC.Classes.Eq Data.Thyme.LocalTime.TimeOfDay instance Data.Hashable.Class.Hashable Data.Thyme.LocalTime.TimeZone instance Control.DeepSeq.NFData Data.Thyme.LocalTime.TimeZone instance GHC.Show.Show Data.Thyme.LocalTime.TimeZone instance GHC.Enum.Bounded Data.Thyme.LocalTime.TimeZone instance System.Random.Random Data.Thyme.LocalTime.TimeZone instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.LocalTime.TimeZone instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.LocalTime.TimeZone -- | International Atomic Time (TAI) and conversion to/from UTC, -- accounting for leap seconds. module Data.Thyme.Clock.TAI -- | Temps Atomique International (TAI). Note that for most -- applications UTCTime is perfectly sufficient, and much more -- convenient to use. -- -- Internally this is the number of seconds since taiEpoch. TAI -- days are exactly 86400 SI seconds long. data AbsoluteTime -- | The Modified Julian Day epoch, which is 1858-11-17 00:00:00 -- TAI. taiEpoch :: AbsoluteTime -- | A table of TAIUTCRows for converting between TAI and UTC. -- -- The two Maps are keyed on the corresponding instants in UTC and -- TAI from which the TAIUTCRow becomes applicable. The -- UTCTime key of the first Map is always at midnight. -- -- No table is provided here because leap seconds are unpredictable, and -- any program shipped with such a table could become out-of-date in as -- little as 6 months. See parseTAIUTCDAT for details. data TAIUTCMap TAIUTCMap :: Map UTCTime TAIUTCRow -> Map AbsoluteTime TAIUTCRow -> TAIUTCMap -- | Each line of tai-utc.dat (see parseTAIUTCDAT) -- specifies the difference between TAI and UTC for a particular period. -- For example: -- --
--   1968 FEB  1 =JD 2439887.5  TAI-UTC=   4.2131700 S + (MJD - 39126.) X 0.002592 S
--   
-- -- says that from 1968-02-01 00:00:00 (Julian Date 2439887.5; or Modified -- Julian Date 39887.0), the difference between TAI and UTC is -- 4.2131700s (the additive part) plus a scaled component -- that increases for each day beyond MJD 39126 (the base) by -- 0.002592s (the coefficient). In general, the latter half of -- each line is of the form: -- --
--   TAI-UTC= additive S + (MJD - base) X coefficient S
--   
-- -- TAIUTCRow a b c is a normalised version of the above, -- with the base multiplied by 86400s, and the coefficient -- divided by the same. This allows us to use the internal representation -- of UTCTime—seconds since the MJD epoch—as the MJD term -- without further rescaling. -- -- Note that between 1961-01-01 and 1972-01-01, each UTC second was -- actually slightly longer than one TAI (or SI) second. For the first -- year this was at the rate of exactly 1.000000015 TAI (or SI) seconds -- per UTC second, but was subject to irregular updates. Since leap -- seconds came into effect on 1972-01-01, the additive part has -- always been an intergral number of seconds, and the coefficient -- has always been zero. -- -- To convert between TAI and UTC, we refer to the definition: -- --
--   TAI - UTC = a + (MJD - b) * c
--   
-- -- Using UTC for MJD (with b and c scaled as described -- above): -- --
--   TAI = UTC + a + (UTC - b) * c
--   TAI - a + b * c = UTC + UTC * c
--   (TAI - a + b * c) / (1 + c) = UTC
--   
-- -- This is implemented by absoluteTime and absoluteTime'. -- -- Further reading: -- -- data TAIUTCRow -- | Each row comprises of an additive component, the base of -- the scaled component, and the coefficient of the scaled -- component. TAIUTCRow :: !DiffTime -> !UTCTime -> !Rational -> TAIUTCRow -- | Convert between UTCTime and AbsoluteTime using a -- TAIUTCMap. -- -- Since UTCTime cannot represent a time-of-day of 86400s or more, -- any conversion from AbsoluteTime that happens to be during a -- leap second will overflow into the next day. -- -- See parseTAIUTCDAT for how to obtain the tum :: -- TAIUTCMap below. -- --
--   > let jul1 = utcTime # UTCView (gregorian # YearMonthDay 2015 7 1) zeroV
--   > jul1 & absoluteTime tum %~ (.-^ fromSeconds 1.1)
--   2015-06-30 23:59:59.9 UTC
--   
absoluteTime :: TAIUTCMap -> Iso' UTCTime AbsoluteTime -- | Convert between UTCView and TAI AbsoluteTime using a -- TAIUTCMap. -- -- Unlike absoluteTime, UTCView can represent a -- time-of-day greater than 86400s, and this gives the correct results -- during a leap second. -- -- See parseTAIUTCDAT for how to obtain the tum :: -- TAIUTCMap below. -- --
--   > let jul1 = UTCView (gregorian # YearMonthDay 2015 7 1) zeroV
--   > jul1 & absoluteTime' tum %~ (.-^ fromSeconds 0.1)
--   UTCView {utcvDay = 2015-06-30, utcvDayTime = 86400.9s}
--   
-- -- However keep in mind that currently there is no standard way to get -- the TAI on most platforms. Simply converting the result of -- getCurrentTime (which calls gettimeofday(2)) to -- AbsoluteTime during a leap second will still give non-monotonic -- times. absoluteTime' :: TAIUTCMap -> Iso' UTCView AbsoluteTime -- | Using a TAIUTCMap, lookup the DiffTime length of the UTC -- Day. -- -- See parseTAIUTCDAT for how to obtain the tum :: -- TAIUTCMap below. -- --
--   > utcDayLength tum . view _utctDay <$> getCurrentTime
--   86400s
--   > utcDayLength tum $ gregorian # YearMonthDay 2015 6 30
--   86401s
--   
utcDayLength :: TAIUTCMap -> Day -> DiffTime -- | attoparsec Parser for a single line of -- tai-utc.dat. -- -- Returns the starting UTCTime and the normalised -- TAIUTCRow. parseTAIUTCRow :: Parser (UTCTime, TAIUTCRow) -- | Build a TAIUTCMap from the result of parseTAIUTCRow. makeTAIUTCMap :: [(UTCTime, TAIUTCRow)] -> TAIUTCMap parseTAIUTCDAT :: ByteString -> Either String TAIUTCMap -- | Add a duration to an AbsoluteTime. -- --
--   addAbsoluteTime = flip (.+^)
--   addAbsoluteTime d t ≡ t .+^ d
--   
-- -- See also the AffineSpace instance for AbsoluteTime. addAbsoluteTime :: DiffTime -> AbsoluteTime -> AbsoluteTime -- | The duration difference between two AbsoluteTimes. -- --
--   diffAbsoluteTime = (.-.)
--   diffAbsoluteTime a b ≡ a .-. b
--   
-- -- See also the AffineSpace instance for AbsoluteTime. diffAbsoluteTime :: AbsoluteTime -> AbsoluteTime -> DiffTime -- | Using a TAIUTCMap, convert a UTCTime to -- AbsoluteTime. -- --
--   utcToTAITime = view . absoluteTime
--   
utcToTAITime :: TAIUTCMap -> UTCTime -> AbsoluteTime -- | Using a TAIUTCMap, convert a AbsoluteTime to -- UTCTime. -- --
--   taiToUTCTime = review . absoluteTime
--   
taiToUTCTime :: TAIUTCMap -> AbsoluteTime -> UTCTime instance GHC.Show.Show Data.Thyme.Clock.TAI.TAIUTCRow instance GHC.Generics.Generic Data.Thyme.Clock.TAI.TAIUTCRow instance Data.Data.Data Data.Thyme.Clock.TAI.TAIUTCRow instance GHC.Classes.Ord Data.Thyme.Clock.TAI.TAIUTCRow instance GHC.Classes.Eq Data.Thyme.Clock.TAI.TAIUTCRow instance GHC.Show.Show Data.Thyme.Clock.TAI.TAIUTCMap instance GHC.Generics.Generic Data.Thyme.Clock.TAI.TAIUTCMap instance Data.Data.Data Data.Thyme.Clock.TAI.TAIUTCMap instance GHC.Classes.Ord Data.Thyme.Clock.TAI.TAIUTCMap instance GHC.Classes.Eq Data.Thyme.Clock.TAI.TAIUTCMap instance GHC.Show.Show Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Vector.Unboxed.Base.Unbox Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Data.Thyme.Clock.TAI.AbsoluteTime instance Data.AffineSpace.AffineSpace Data.Thyme.Clock.TAI.AbsoluteTime instance Test.QuickCheck.Arbitrary.CoArbitrary Data.Thyme.Clock.TAI.AbsoluteTime instance Test.QuickCheck.Arbitrary.Arbitrary Data.Thyme.Clock.TAI.AbsoluteTime instance System.Random.Random Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Enum.Bounded Data.Thyme.Clock.TAI.AbsoluteTime instance Control.DeepSeq.NFData Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Hashable.Class.Hashable Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Ix.Ix Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Enum.Enum Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Generics.Generic Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Data.Data Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Classes.Ord Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Classes.Eq Data.Thyme.Clock.TAI.AbsoluteTime -- | Formatting and parsing for dates and times. module Data.Thyme.Format -- | All instances of this class may be formatted by formatTime. class FormatTime t showsTime :: FormatTime t => TimeLocale -> t -> (Char -> ShowS) -> Char -> ShowS -- | Format a FormatTime instance value according to a template -- string. -- -- These formatting template codes are intended to be compatible with -- glibc strftime() function, following -- Data.Time.Format, which follows formatCalendarTime from -- the old-time package. Codes which differ from -- strftime() are marked as EXTENSION. -- --

Show/Parse template string spec

-- --

For all types

-- -- -- --

For TimeZone (and ZonedTime and -- UTCTime):

-- -- -- -- -- --

For LocalTime (and ZonedTime and UTCTime and -- UniversalTime)

-- -- -- --

For TimeOfDay (and LocalTime and ZonedTime -- and UTCTime and UniversalTime)

-- -- -- -- -- --

For UTCTime

-- -- -- --

For Day (and LocalTime and ZonedTime and -- UTCTime and UniversalTime)

-- -- -- -- -- --

Examples

-- --

ISO 8601

-- --
--   > formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%N" $ mkUTCTime 2015 1 15  12 34 56.78
--   "2015-01-15T12:34:56+00:00"
--   
-- --

RFC822

-- --
--   > formatTime defaultTimeLocale "%a, %_d %b %Y %H:%M:%S %Z" $ mkUTCTime 2015 1 15  12 34 56.78
--   "Thu, 15 Jan 2015 12:34:56 UTC"
--   
-- --

YYYY-MM-DD hh:mm:ss.000000

-- --
--   > formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S.%v" $ mkUTCTime 2015 1 15  12 34 56.78
--   "2015-01-15 12:34:56.780000"
--   
formatTime :: FormatTime t => TimeLocale -> String -> t -> String -- | All instances of this class may be parsed by parseTime, -- readTime, and readsTime. class ParseTime t buildTime :: ParseTime t => TimeParse -> t -- | Parse a string as a ParseTime instance value. -- -- Return Nothing if parsing fails. -- --

Examples

-- --

ISO 8601

-- --
--   > parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%N" "2015-01-15T12:34:56+00:00" :: Maybe UTCTime
--     Just 2015-01-15 12:34:56 UTC
--   
--   > parseTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%N" "2015-01-15T12:34:56-12:00" :: Maybe UTCTime
--     Just 2015-01-16 00:34:56 UTC
--   
-- --

YYYY-MM-DD hh:mm:ss.0

-- --
--   > parseTime defaultTimeLocale "%Y-%m-%d %H:%M:%S%Q" "2015-01-15 12:34:56.78" :: Maybe UTCTime
--     Just 2015-01-15 12:34:56.78 UTC
--   
parseTime :: ParseTime t => TimeLocale -> String -> String -> Maybe t -- | Parse a string as a ParseTime instance value. -- -- Call error if parsing fails. readTime :: ParseTime t => TimeLocale -> String -> String -> t -- | Produce a ReadS to parse a string as a ParseTime -- instance value. readsTime :: ParseTime t => TimeLocale -> String -> ReadS t -- | Unconstituted date-time for parsing. data TimeParse TimeParse :: {-# UNPACK #-} !Int -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Month -> {-# UNPACK #-} !WeekOfYear -> {-# UNPACK #-} !DayOfMonth -> {-# UNPACK #-} !DayOfYear -> {-# UNPACK #-} !DayOfWeek -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !Hour -> {-# UNPACK #-} !Minute -> {-# UNPACK #-} !Int -> {-# UNPACK #-} !DiffTime -> {-# UNPACK #-} !POSIXTime -> !TimeZone -> TimeParse [tpCentury] :: TimeParse -> {-# UNPACK #-} !Int [tpCenturyYear] :: TimeParse -> {-# UNPACK #-} !Int [tpMonth] :: TimeParse -> {-# UNPACK #-} !Month [tpWeekOfYear] :: TimeParse -> {-# UNPACK #-} !WeekOfYear [tpDayOfMonth] :: TimeParse -> {-# UNPACK #-} !DayOfMonth [tpDayOfYear] :: TimeParse -> {-# UNPACK #-} !DayOfYear [tpDayOfWeek] :: TimeParse -> {-# UNPACK #-} !DayOfWeek [tpFlags] :: TimeParse -> {-# UNPACK #-} !Int [tpHour] :: TimeParse -> {-# UNPACK #-} !Hour [tpMinute] :: TimeParse -> {-# UNPACK #-} !Minute [tpSecond] :: TimeParse -> {-# UNPACK #-} !Int [tpSecFrac] :: TimeParse -> {-# UNPACK #-} !DiffTime [tpPOSIXTime] :: TimeParse -> {-# UNPACK #-} !POSIXTime [tpTimeZone] :: TimeParse -> !TimeZone -- | Produce a Parser for UTF-8 encoded ByteStrings. -- -- This function is used internally by parseTime, readTime, -- and readsTime; consider using one of those functions instead. -- -- Attoparsec easily beats any String parser out there, but we do -- have to be careful to convert the input to UTF-8 ByteStrings. timeParser :: TimeLocale -> String -> Parser TimeParse data TimeLocale TimeLocale :: [(String, String)] -> [(String, String)] -> (String, String) -> String -> String -> String -> String -> [TimeZone] -> TimeLocale -- | full and abbreviated week days, starting with Sunday [wDays] :: TimeLocale -> [(String, String)] -- | full and abbreviated months [months] :: TimeLocale -> [(String, String)] -- | AM/PM symbols [amPm] :: TimeLocale -> (String, String) -- | formatting strings [dateTimeFmt] :: TimeLocale -> String -- | formatting strings [dateFmt] :: TimeLocale -> String -- | formatting strings [timeFmt] :: TimeLocale -> String -- | formatting strings [time12Fmt] :: TimeLocale -> String -- | time zones known by name [knownTimeZones] :: TimeLocale -> [TimeZone] -- | Locale representing American usage. -- -- knownTimeZones contains only the ten time-zones mentioned in -- RFC 802 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. defaultTimeLocale :: TimeLocale instance GHC.Show.Show Data.Thyme.Format.TimeFlag instance GHC.Enum.Enum Data.Thyme.Format.TimeFlag instance GHC.Show.Show Data.Thyme.Format.TimeParse instance GHC.Read.Read Data.Thyme.Clock.Internal.UTCView instance Data.Thyme.Format.ParseTime Data.Thyme.LocalTime.TimeOfDay instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.YearMonthDay instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.MonthDay instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.OrdinalDate instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.WeekDate instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.SundayWeek instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.MondayWeek instance Data.Thyme.Format.ParseTime Data.Thyme.LocalTime.LocalTime instance Data.Thyme.Format.ParseTime Data.Thyme.Calendar.Internal.Day instance Data.Thyme.Format.ParseTime Data.Thyme.LocalTime.TimeZone instance Data.Thyme.Format.ParseTime Data.Thyme.LocalTime.ZonedTime instance Data.Thyme.Format.ParseTime Data.Thyme.Clock.Internal.UTCTime instance Data.Thyme.Format.ParseTime Data.Thyme.Clock.Internal.UniversalTime instance Data.Thyme.Format.ParseTime Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Thyme.Format.FormatTime Data.Thyme.LocalTime.TimeOfDay instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.YearMonthDay instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.MonthDay instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.OrdinalDate instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.WeekDate instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.SundayWeek instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.MondayWeek instance Data.Thyme.Format.FormatTime Data.Thyme.LocalTime.LocalTime instance Data.Thyme.Format.FormatTime Data.Thyme.Calendar.Internal.Day instance Data.Thyme.Format.FormatTime Data.Thyme.LocalTime.TimeZone instance Data.Thyme.Format.FormatTime Data.Thyme.LocalTime.ZonedTime instance Data.Thyme.Format.FormatTime Data.Thyme.Clock.Internal.UTCTime instance Data.Thyme.Format.FormatTime Data.Thyme.Clock.Internal.UniversalTime instance Data.Thyme.Format.FormatTime Data.Thyme.Clock.TAI.AbsoluteTime instance GHC.Read.Read Data.Thyme.Calendar.Internal.Day instance GHC.Read.Read Data.Thyme.LocalTime.TimeOfDay instance GHC.Read.Read Data.Thyme.LocalTime.LocalTime instance GHC.Read.Read Data.Thyme.LocalTime.ZonedTime instance GHC.Read.Read Data.Thyme.Clock.Internal.UTCTime -- | This simply re-exports some commonly-used modules. module Data.Thyme -- | Instances of FromJSON and ToJSON for UTCTime and -- ZonedTime, along with a newtype wrapper DotNetTime. module Data.Thyme.Format.Aeson -- | A newtype wrapper for UTCTime that uses the same non-standard -- serialization format as Microsoft .NET, whose System.DateTime -- type is by default serialized to JSON as in the following example: -- --
--   /Date(1302547608878)/
--   
-- -- The number represents milliseconds since the Unix epoch. newtype DotNetTime DotNetTime :: UTCTime -> DotNetTime [fromDotNetTime] :: DotNetTime -> UTCTime instance Data.Thyme.Format.FormatTime Data.Thyme.Format.Aeson.DotNetTime instance GHC.Show.Show Data.Thyme.Format.Aeson.DotNetTime instance GHC.Read.Read Data.Thyme.Format.Aeson.DotNetTime instance GHC.Classes.Ord Data.Thyme.Format.Aeson.DotNetTime instance GHC.Classes.Eq Data.Thyme.Format.Aeson.DotNetTime instance Data.Aeson.Types.ToJSON.ToJSON Data.Thyme.Format.Aeson.DotNetTime instance Data.Aeson.Types.FromJSON.FromJSON Data.Thyme.Format.Aeson.DotNetTime instance Data.Aeson.Types.ToJSON.ToJSON Data.Thyme.LocalTime.ZonedTime instance Data.Aeson.Types.FromJSON.FromJSON Data.Thyme.LocalTime.ZonedTime instance Data.Aeson.Types.ToJSON.ToJSON Data.Thyme.Clock.Internal.UTCTime instance Data.Aeson.Types.FromJSON.FromJSON Data.Thyme.Clock.Internal.UTCTime -- | This module provides the Thyme typeclass, and instances for -- converting between Data.Time and Data.Thyme types. It -- also provides compatibility wrappers for existing code using -- Data.Time. -- -- Note that we do not provide Num hierarchy instances for -- DiffTime nor NominalDiffTime here. If you want to use -- them anyway despite parts of them being ill-defined (e.g. -- (*) on DiffTime), import Data.Thyme.Time -- instead. module Data.Thyme.Time.Core -- | Typeclass for converting between Data.Time and -- Data.Thyme types. class Thyme time thyme | thyme -> time -- | Convert between Data.Time and Data.Thyme types. -- --
--   > :set -t
--   > import qualified Data.Time
--   
--   > thyme # (fromSeconds' 10 :: DiffTime)
--   10s
--   it :: DiffTime
--   
--   > secondsToDiffTime 10 ^. thyme :: DiffTime
--   10s
--   it :: DiffTime
--   
thyme :: Thyme time thyme => Iso' time thyme -- | Convert a Data.Time type to a Data.Thyme type, if you -- would rather not use Control.Lens directly. -- --
--   toThyme = view thyme
--   toThyme t ≡ t ^. thyme
--   
toThyme :: Thyme time thyme => time -> thyme -- | Convert a Data.Thyme type to a Data.Time type, if you -- would rather not use Control.Lens directly. -- --
--   fromThyme = review thyme
--   fromThyme t ≡ thyme # t
--   
fromThyme :: Thyme time thyme => thyme -> time instance Data.Thyme.Time.Core.Thyme Data.Time.Calendar.Days.Day Data.Thyme.Calendar.Internal.Day instance Data.Thyme.Time.Core.Thyme Data.Time.Clock.Internal.UniversalTime.UniversalTime Data.Thyme.Clock.Internal.UniversalTime instance Data.Thyme.Time.Core.Thyme Data.Time.Clock.Internal.DiffTime.DiffTime Data.Thyme.Clock.Internal.DiffTime instance Data.Thyme.Time.Core.Thyme Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime Data.Thyme.Clock.Internal.NominalDiffTime instance Data.Thyme.Time.Core.Thyme Data.Time.Clock.Internal.UTCTime.UTCTime Data.Thyme.Clock.Internal.UTCView instance Data.Thyme.Time.Core.Thyme Data.Time.Clock.Internal.UTCTime.UTCTime Data.Thyme.Clock.Internal.UTCTime instance Data.Thyme.Time.Core.Thyme Data.Time.Clock.Internal.AbsoluteTime.AbsoluteTime Data.Thyme.Clock.TAI.AbsoluteTime instance Data.Thyme.Time.Core.Thyme Data.Time.LocalTime.Internal.TimeZone.TimeZone Data.Thyme.LocalTime.TimeZone instance Data.Thyme.Time.Core.Thyme Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay Data.Thyme.LocalTime.TimeOfDay instance Data.Thyme.Time.Core.Thyme Data.Time.LocalTime.Internal.LocalTime.LocalTime Data.Thyme.LocalTime.LocalTime instance Data.Thyme.Time.Core.Thyme Data.Time.LocalTime.Internal.ZonedTime.ZonedTime Data.Thyme.LocalTime.ZonedTime -- | This module provides Num, Real, Fractional, and -- RealFrac instances for DiffTime and -- NominalDiffTime. module Data.Thyme.Time instance GHC.Num.Num Data.Thyme.Clock.Internal.DiffTime instance GHC.Real.Real Data.Thyme.Clock.Internal.DiffTime instance GHC.Real.Fractional Data.Thyme.Clock.Internal.DiffTime instance GHC.Real.RealFrac Data.Thyme.Clock.Internal.DiffTime instance GHC.Num.Num Data.Thyme.Clock.Internal.NominalDiffTime instance GHC.Real.Real Data.Thyme.Clock.Internal.NominalDiffTime instance GHC.Real.Fractional Data.Thyme.Clock.Internal.NominalDiffTime instance GHC.Real.RealFrac Data.Thyme.Clock.Internal.NominalDiffTime instance GHC.Num.Num Data.Thyme.Internal.Micro.Micro instance GHC.Real.Real Data.Thyme.Internal.Micro.Micro instance GHC.Real.Fractional Data.Thyme.Internal.Micro.Micro instance GHC.Real.RealFrac Data.Thyme.Internal.Micro.Micro module Data.Thyme.Docs