time-exts-1.0.2: Efficient Timestamps

Safe HaskellNone

Data.Time.Exts.Base

Contents

Synopsis

Classes

class DateTimeMath a b whereSource

Methods

plus :: a -> b -> aSource

Instances

DateTimeMath UnixDateTimePicos Picos 
DateTimeMath UnixDateTimePicos Nanos 
DateTimeMath UnixDateTimePicos Micros 
DateTimeMath UnixDateTimePicos Millis 
DateTimeMath UnixDateTimePicos Second 
DateTimeMath UnixDateTimePicos Minute 
DateTimeMath UnixDateTimePicos Hour 
DateTimeMath UnixDateTimePicos Day 
DateTimeMath UnixDateTimeNanos Nanos 
DateTimeMath UnixDateTimeNanos Micros 
DateTimeMath UnixDateTimeNanos Millis 
DateTimeMath UnixDateTimeNanos Second 
DateTimeMath UnixDateTimeNanos Minute 
DateTimeMath UnixDateTimeNanos Hour 
DateTimeMath UnixDateTimeNanos Day 
DateTimeMath UnixDateTimeMicros Micros 
DateTimeMath UnixDateTimeMicros Millis 
DateTimeMath UnixDateTimeMicros Second 
DateTimeMath UnixDateTimeMicros Minute 
DateTimeMath UnixDateTimeMicros Hour 
DateTimeMath UnixDateTimeMicros Day 
DateTimeMath UnixDateTimeMillis Millis 
DateTimeMath UnixDateTimeMillis Second 
DateTimeMath UnixDateTimeMillis Minute 
DateTimeMath UnixDateTimeMillis Hour 
DateTimeMath UnixDateTimeMillis Day 
DateTimeMath UnixDateTime Second 
DateTimeMath UnixDateTime Minute 
DateTimeMath UnixDateTime Hour 
DateTimeMath UnixDateTime Day 
DateTimeMath UnixDate Day 
DateTimeMath LocalDateTimePicos Picos 
DateTimeMath LocalDateTimePicos Nanos 
DateTimeMath LocalDateTimePicos Micros 
DateTimeMath LocalDateTimePicos Millis 
DateTimeMath LocalDateTimePicos Second 
DateTimeMath LocalDateTimeNanos Nanos 
DateTimeMath LocalDateTimeNanos Micros 
DateTimeMath LocalDateTimeNanos Millis 
DateTimeMath LocalDateTimeNanos Second 
DateTimeMath LocalDateTimeMicros Micros 
DateTimeMath LocalDateTimeMicros Millis 
DateTimeMath LocalDateTimeMicros Second 
DateTimeMath LocalDateTimeMillis Millis 
DateTimeMath LocalDateTimeMillis Second 
DateTimeMath LocalDateTime Second 
DateTimeMath LocalDate Day 

Structs

data DateStruct Source

A struct with date components.

Constructors

DateStruct 

Fields

_d_year :: !Year

year

_d_mon :: !Month

month

_d_mday :: !Day

day of month

_d_wday :: !DayOfWeek

day of week

data DateZoneStruct Source

A struct with date and zone components.

Constructors

DateZoneStruct 

Fields

_dz_year :: !Year

year

_dz_mon :: !Month

month

_dz_mday :: !Day

day of month

_dz_wday :: !DayOfWeek

day of week

_dz_zone :: !TimeZone

time zone

data DateTimeStruct Source

A struct with date and time components.

Constructors

DateTimeStruct 

Fields

_dt_year :: !Year

year

_dt_mon :: !Month

month

_dt_mday :: !Day

day of month

_dt_wday :: !DayOfWeek

day of week

_dt_hour :: !Hour

hour

_dt_min :: !Minute

minute

_dt_sec :: !Double

second

Components

Pretty

prettyMonth :: Month -> StringSource

Show the given month as a string.

prettyDay :: Day -> StringSource

Show the given day of the 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.