r+5      !"#$%&'()*+,-./01234 Safe-Inferred5DConvert Year-Month-Day to since 0000-01-01 in the Gregorian Calendar#year 0 is a leap year#year 400 is a leap year#year 100,200,300 is not a leap year#year / 4 is a leap year#year (-4) (5 BC) is a leap year6789:;<5=>?@AB6789:;<5=>?@AB6789:;<5=>?@AB Safe-Inferred+4All non-total functions within this library throw a  exception within a  context. Use ) to specifically catch this exception.The Cz contains information that might be useful for debugging, but its specific form is undefined and must not be relied on.DDSafeJThis class is for types that have a well-defined mapping to and from the  'https://en.wikipedia.org/wiki/Unix_time Unix Time system (based on  8https://en.wikipedia.org/wiki/Coordinated_Universal_TimeUTC).BewareE: It is a common misconception that the Unix time in general counts  ;https://en.wikipedia.org/wiki/International_System_of_UnitsSIV seconds since 1970-01-01T00:00:00Z. There is a common definition that may be called Unix time based on UTCS: In general, the second boundaries match with UTC, but in the event of a positive (or negative) leap second the Unix second has a duration of 2 (or 0) SI seconds. This library is in accordance with this definition. This definition can also be understood as "ignoring leap seconds" (a Unix day therefore always has 86400 Unix seconds).HThe concrete behaviour of your system clock is implementation dependant.SafeOThis class defines an interface for contexts that can be asked for a timestamp.'Most users are likely to just need the E3 instance, but you might think of other instances:pA wrapper around the system clock with internal state that ensures strict monotonically increasing values.KA custom monadic computation that needs time, but should not be given E access.MTesting contexts where you might want to inject and test specific timestamps.2Get a timestamp from the surrounding context. The E instance gives access to the  system clock1 and is what most users are probably looking for.Beware: The E instance does not guarantee that subsequent calls are monotonically increasing. The system's clock might stop or even go backwards when synchronised manually or via NTP or when adapting to a leap second.Example: |import Data.UTC printCurrentYear :: IO () printCurrentYear = do now <- getUnixTime :: IO DateTime print (year now)FF Safe FThis class captures the concept of a 24-hour clock time during a day.$Returns values in the range 0 to 23. $Returns values in the range 0 to 59. $Returns values in the range 0 to 59. +Returns values in the range 0.0 <= x < 1.0. $Accepts values in the range 0 to 23.VThe function fails if the result cannot be represented by the type (cannot happen for   and  ). $Accepts values in the range 0 to 59.VThe function fails if the result cannot be represented by the type (cannot happen for   and  ).$Accepts values in the range 0 to 59.VThe function fails if the result cannot be represented by the type (cannot happen for   and  ).+Accepts values in the range 0.0 <= x < 1.0.VThe function fails if the result cannot be represented by the type (cannot happen for   and  ).8Adds an arbitrary count of hours (positive or negative).Full days flow over to  $ if the type is also an instance of   (this is the case for  ).Types not implementing the  : class should just ignore the days part on overflow (like   does).IFails if the result cannot be represented by the type (cannot happen for   and  ).:Adds an arbitrary count of minutes (positive or negative).Full hours flow over to .IFails if the result cannot be represented by the type (cannot happen for   and  ).:Adds an arbitrary count of seconds (positive or negative).Full minutes flow over to .IFails if the result cannot be represented by the type (cannot happen for   and  ).9Adds an arbitrary second fraction (positive or negative).Full seconds flow over to .NInstances of this class are not required to preserve full precision (although   and   do so).IFails if the result cannot be represented by the type (cannot happen for   and  ).      Safe"The instant in time also known as  the epoch: 1970-01-01T00:00:00ZSafe )This class captures the behaviour of the Proleptic Gregorian Calendar.*Without any exception the following holds:GA regular year has 365 days and the corresponding February has 28 days.DA leap year has 366 days and the corresponding February has 29 days.0A year that is a multiple of 400 is a leap year.CA year that is a multiple of 100 but not of 400 is not a leap year.=A year that is a multiple of 4 but not of 100 is a leap year. year "2014- `12- `24" == 2014For negative years the function assumes astronomical year numbering (year 1 ~ 1 AD, year 0 ~ 1 BC, year -1 ~ 2 BC etc). Note that 1 BC and 5 BC are therefore leap years. month "2014- `12- `24" == 126The function only returns values ranging from 1 to 12. day "2014- `12- `24" == 246The function only returns values ranging from 1 to 31.7Sets the year and fails if the result would be invalid. ksetYear 2005 "2004-02-28" :: Maybe Date > Just 2005-02-28 setYear 2005 "2004-02-29" :: Maybe Date > Nothing@Sets the month of year and fails if the result would be invalid.5The function only accepts input ranging from 1 to 12.?Sets the day of month and fails if the result would be invalid.[The function only accepts input ranging from 1 to 31 (or less depending on month and year).A yearE is a relative amount of time. The function's semantic is a follows:+The years (positive or negative) are added.QIf the target date is invalid then days are subtracted until the date gets valid.fIf the resulting date is out of the instance type's range, the function fails (cannot happen for  and  , as they use multiprecision integers). oaddYears 4 "2000-02-29" :: Maybe Date > Just 2004-02-29 addYears 1 "2000-02-29" :: Maybe Date > Just 2001-02-28A monthQ is a relative amount of time. The function's semantic is equivalent to that of .aThe function fails if the resulting date is out of the instance type's range (cannot happen for  and  ) as they use multiprecision integers). <addMonths (-13) "1970-01-01" :: Maybe Date > Just 1968-12-01A day? is an absolute amount of time. There is no surprise to expect.aThe function fails if the resulting date is out of the instance type's range (cannot happen for  and  ) as they use multiprecision integers). qaddDays 365 "1970-01-01" :: Maybe Date > Just 1971-01-01 addDays 365 "2000-01-01" :: Maybe Date > Just 2000-12-31    Safe-Inferred24!YYYYMMDD" YYYY-MM-DD (extended format)#hhmmss$hh:mm:ss (extended format)%hhmm&hh:mm (extended format) !"#$%&GHIJKL !"#$%&G !"#$%&GHIJKL Safe-Inferred'"This type represents dates in the Proleptic Gregorian Calendar.FIt can represent any date in the past and in the future by using M internally.\The internal structure is not exposed to avoid the construction of invalid values. Use ! or a parser to construct values.The instance of ND is only meant for debugging purposes and is subject to change. !> show (epoch :: Date) 1970-01-01 'OPQRSTUV''OPQRSTUV Safe-Inferred(1This type represents time instants during a day (00:00:00 - 23:59:59.999&..) with arbitrary precision (uses M internally).]The internal structure is not exposed to avoid the creation of invalid values. Use ! or a parser to construct values.The instance of ND is only meant for debugging purposes and is subject to change. > show (epoch :: Time) 00:00:00 (WXYZ[\]^_((WXYZ[\]^_Safe24)_This type is used to extend UTC time types by a local offset in seconds (positive or negative).Beware: A local offset is not a time zone. It is just a fix period of time. In contrast to a time zone this does not take summer or winter time into account.+ `*The local offset is unknown (behaves like Western European Time)a 0 UTC+00:00 (Western European Time)a 3600 UTC+01:00 (Central European Time),)The time to be interpreted as UTC+00:00 (Western European Time) )*+,bcdefg)*+,)*+,bcdefg Safe-Inferred24-!A time representation based on a  and the   of the day.The type uses multiprecision integers internally and is able to represent any UTC date in the past and in the future with arbitrary precision (apart from the time span within a leap second).The instance of NH is only meant for debugging purposes. Don't rely on its behaviour! .> show (epoch :: DateTime) 1970-01-01T00:00:00 -./0hijklmn-./0-./0hijklmn Safe-Inferred '()*+,-./0Safeooo Safe-Inferredppp Safe-Inferred241 setYear 1987 (epoch :: DateTime) >>= setMonth 7 >>= setDay 10 >>= setHour 12 >>= setMinute 4 >>= return . (flip Local) (Just 0) >>= renderRfc3339 :: Maybe String > Just "1987-07-10T12:04:00Z"1234qrstuvwxyzop1234 1234qrstuvwxyz  Safe-Inferred  Safe-Inferred5  !"#$%&'()*+,-./012345 '(-./0)*+,3412 !"#$%&{ ! " # $ % & ' ( ) * + , - ./01234567 89:;<=> ??@A  BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefVghijklmno pqrstuvwVxyVxz{|}~{ utc-0.2.0.1Data.UTCData.UTC.InternalData.UTC.Type.ExceptionControl.Monad.Catch MonadThrow MonadCatchData.UTC.Class.IsUnixTimeData.UTC.Class.HasUnixTimeData.UTC.Class.IsTimeTimeDateTimeaddDaysData.UTC.ClassIsDateData.UTC.Class.EpochData.UTC.Class.IsDateDateData.UTC.Format.Iso8601Data.UTC.Type.DateepochData.UTC.Type.TimeData.UTC.Type.LocalData.UTC.Type.DateTime Data.UTC.TypeData.UTC.Format.Rfc3339.BuilderData.UTC.Format.Rfc3339.ParserData.UTC.Format.Rfc3339 UtcException IsUnixTime unixSecondsfromUnixSeconds HasUnixTime getUnixTimeIsTimehourminutesecondsecondFractionsetHour setMinute setSecondsetSecondFractionaddHours addMinutes addSecondsaddSecondFractionsEpochyearmonthdaysetYearsetMonthsetDayaddYears addMonthsIso8601RendererrenderIso8601CalendarDaterenderIso8601CalendarDate'renderIso8601TimeHmsrenderIso8601TimeHms'renderIso8601TimeHmrenderIso8601TimeHm'LocaloffsetutcdatetimeRfc3339Renderer renderRfc3339 Rfc3339Parser parseRfc3339yearMonthDayToDaysdeltaUnixEpochCommonEpoch secsPerDay secsPerHour secsPerMinute minsPerHour hoursPerDay monthsPerYear yearToDays daysToYeardaysToYearMonthDay isValidDate fixedDecimaldecimalFractionbaseGHC.BaseString$fExceptionUtcExceptionghc-prim GHC.TypesIO$fHasUnixTimeIO timeDigits$fIso8601RendererByteString$fIso8601Renderer[]$fIso8601RendererText$fIso8601RendererText0$fIso8601RendererByteString0 integer-gmpGHC.Integer.TypeIntegerGHC.ShowShowdYeardMonthdDay $fIsDateDate$fIsUnixTimeDate $fEpochDate $fShowDatetHourtMinutetSecondtSecondFraction $fIsTimeTime$fIsUnixTimeTime $fEpochTime $fShowTime Data.MaybeNothingJust $fIsTimeLocal$fBoundedLocal$fFunctorLocal $fEpochLocal $fOrdLocal $fEqLocal $fIsDateLocal$fIsTimeDateTime$fIsDateDateTime$fIsUnixTimeDateTime$fEpochDateTime$fShowDateTimerfc3339Builder rfc3339Parser$fRfc3339Renderer[]$fRfc3339RendererText$fRfc3339RendererText0$fRfc3339RendererByteString$fRfc3339RendererByteString0$fRfc3339Parser[]$fRfc3339ParserText$fRfc3339ParserText0$fRfc3339ParserByteString$fRfc3339ParserByteString0