chronos-1.0: A performant time library

Chronos

Synopsis

# Functions

## Current

Gets the current Day. This does not take the user's time zone into account.

## Construction

datetimeFromYmdhms :: Int -> Int -> Int -> Int -> Int -> Int -> Datetime Source #

Construct a Datetime from year, month, day, hour, minute, second:

>>> datetimeFromYmdhms 2014 2 26 17 58 52
foobar


timeFromYmdhms :: Int -> Int -> Int -> Int -> Int -> Int -> Time Source #

## Conversion

Convert Time to Datetime.

Convert Datetime to Time.

Convert Time to OffsetDatetime by providing an Offset.

Convert OffsetDatetime to Time.

Convert Time to Day. This function is lossy; consequently, it does not roundtrip with dayToTimeMidnight.

Convert midnight of the given Day to Time.

Convert Day to a Date.

Convert Date to a Day.

## Matching

buildDayOfWeekMatch :: a -> a -> a -> a -> a -> a -> a -> DayOfWeekMatch a Source #

buildMonthMatch :: a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> a -> MonthMatch a Source #

## Format

The formats provided is this module are language-agnostic. To find meridiem formats and month formats, look in a language-specific module.

# Textual Conversion

## Date

### Text

This could be written much more efficiently since we know the exact size the resulting Text will be.

## Time of Day

### Text

Parses text that is formatted as either of the following:

• %H:%M
• %H:%M:%S

That is, the seconds and subseconds part is optional. If it is not provided, it is assumed to be zero. This format shows up in Google Chrome's datetime-local inputs.

### UTF-8 ByteString

Parses text that is formatted as either of the following:

• %H:%M
• %H:%M:%S

That is, the seconds and subseconds part is optional. If it is not provided, it is assumed to be zero. This format shows up in Google Chrome's datetime-local inputs.

## Datetime

### Text

This could be written much more efficiently since we know the exact size the resulting Text will be.