Safe Haskell | None |
---|
- class Date d where
- toDateStruct :: d -> DateStruct
- fromDateStruct :: DateStruct -> d
- class Zone z where
- class DateZone dz where
- toDateZoneStruct :: dz -> DateZoneStruct
- fromDateZoneStruct :: DateZoneStruct -> dz
- class DateTime dt where
- toDateTimeStruct :: dt -> DateTimeStruct
- fromDateTimeStruct :: DateTimeStruct -> dt
- class DateTimeZone dtz where
- toDateTimeZoneStruct :: dtz -> DateTimeZoneStruct
- fromDateTimeZoneStruct :: DateTimeZoneStruct -> dtz
- class DateTimeMath a b where
- plus :: a -> b -> a
- data DateStruct = DateStruct {}
- data DateZoneStruct = DateZoneStruct {}
- data DateTimeStruct = DateTimeStruct {}
- data DateTimeZoneStruct = DateTimeZoneStruct {}
- newtype Year = Year {}
- newtype Month = Month {}
- newtype Day = Day {}
- data DayOfWeek
- newtype Hour = Hour {}
- newtype Minute = Minute {}
- newtype Second = Second {}
- newtype Millis = Millis {}
- newtype Micros = Micros {}
- newtype Nanos = Nanos {}
- newtype Picos = Picos {}
- class Pretty a where
- prettyMonth :: Month -> String
- prettyDay :: Day -> String
- prettyHour :: Hour -> (Hour, String)
- properFracMillis :: Floating a => RealFrac a => a -> (Second, Millis)
- properFracMicros :: Floating a => RealFrac a => a -> (Second, Micros)
- properFracNanos :: Floating a => RealFrac a => a -> (Second, Nanos)
- properFracPicos :: Floating a => RealFrac a => a -> (Second, Picos)
- epochToDate :: Year -> Month -> Day -> Day
- epochToYear :: Year -> Day
- yearToMonth :: Month -> Bool -> Day
- dateToTime :: Hour -> Minute -> Second -> Second
- isLeapYear :: Year -> Bool
Classes
toDateStruct :: d -> DateStructSource
fromDateStruct :: DateStruct -> dSource
toDateZoneStruct :: dz -> DateZoneStructSource
fromDateZoneStruct :: DateZoneStruct -> dzSource
toDateTimeStruct :: dt -> DateTimeStructSource
fromDateTimeStruct :: DateTimeStruct -> dtSource
class DateTimeZone dtz whereSource
toDateTimeZoneStruct :: dtz -> DateTimeZoneStructSource
class DateTimeMath a b whereSource
Structs
Components
Year.
Month.
Day.
Day of the week.
Hour.
Minute.
Second.
Millisecond.
Microsecond.
Nanosecond.
Picosecond.
Pretty
Show a timestamp in a more human-readable format than the default Show
instance.
prettyMonth :: Month -> StringSource
Show the given month as a string.
prettyHour :: Hour -> (Hour, String)Source
Return the given hour in AM-PM format.
Fractions
properFracMillis :: Floating a => RealFrac a => a -> (Second, Millis)Source
Decompose a floating point number into second and millisecond components.
properFracMicros :: Floating a => RealFrac a => a -> (Second, Micros)Source
Decompose a floating point number into second and microsecond components.
properFracNanos :: Floating a => RealFrac a => a -> (Second, Nanos)Source
Decompose a floating point number into second and nanosecond components.
properFracPicos :: Floating a => RealFrac a => a -> (Second, Picos)Source
Decompose a floating point number into second and picosecond components.
Durations
epochToDate :: Year -> Month -> Day -> DaySource
Calculate the number of days that have elapsed between Unix epoch and the given date.
epochToYear :: Year -> DaySource
Calculate the number of days that have elapsed between Unix epoch and the given year.
yearToMonth :: Month -> Bool -> DaySource
Calculate the number of days that have elapsed between January 1st and the given month.
dateToTime :: Hour -> Minute -> Second -> SecondSource
Calculate the number of seconds that have elapsed between midnight and the given time.
Utilities
isLeapYear :: Year -> BoolSource
Check if the given year is a leap year.