Copyright | 2013-2017 Enzo Haussecker |
---|---|
License | BSD3 |
Maintainer | Enzo Haussecker <enzo@sovereign.io> |
Stability | Stable |
Safe Haskell | None |
Language | Haskell2010 |
A native implementation of Unix Time.
- newtype UnixDate cal = UnixDate Int32
- newtype UnixDateTime cal = UnixDateTime Int64
- data UnixDateTimeNanos cal = UnixDateTimeNanos !Int64 !Int32
- createUnixDate :: Year -> Month Gregorian -> Day -> UnixDate Gregorian
- createUnixDateTime :: Year -> Month Gregorian -> Day -> Hour -> Minute -> Second -> UnixDateTime Gregorian
- createUnixDateTimeNanos :: Year -> Month Gregorian -> Day -> Hour -> Minute -> Second -> Nanos -> UnixDateTimeNanos Gregorian
- getCurrentUnixDate :: IO (UnixDate Gregorian)
- getCurrentUnixDateTime :: IO (UnixDateTime Gregorian)
- getCurrentUnixDateTimeNanos :: IO (UnixDateTimeNanos Gregorian)
- parseUnixDate :: TimeLocale -> Format -> Text -> Either String (UnixDate Gregorian)
- parseUnixDateTime :: TimeLocale -> Format -> Text -> Either String (UnixDateTime Gregorian)
- parseUnixDateTimeNanos :: TimeLocale -> Format -> Text -> Either String (UnixDateTimeNanos Gregorian)
Timestamps
Days since Unix epoch.
Bounded (UnixDate Gregorian) Source # | |
Enum (UnixDate Gregorian) Source # | |
Eq (UnixDate cal) Source # | |
Typeable Calendar cal => Data (UnixDate cal) Source # | |
Ord (UnixDate cal) Source # | |
Show (UnixDate Gregorian) Source # | |
Generic (UnixDate cal) Source # | |
Storable (UnixDate cal) Source # | |
NFData (UnixDate cal) Source # | |
Random (UnixDate Gregorian) Source # | |
Human (UnixDate Gregorian) Source # | |
Math (UnixDate Gregorian) Day Source # | |
type Rep (UnixDate cal) Source # | |
type Components (UnixDate Gregorian) Source # | |
newtype UnixDateTime cal Source #
Seconds since Unix epoch (excluding leap seconds).
Bounded (UnixDateTime Gregorian) Source # | |
Enum (UnixDateTime Gregorian) Source # | |
Eq (UnixDateTime cal) Source # | |
Typeable Calendar cal => Data (UnixDateTime cal) Source # | |
Ord (UnixDateTime cal) Source # | |
Show (UnixDateTime Gregorian) Source # | |
Generic (UnixDateTime cal) Source # | |
Storable (UnixDateTime cal) Source # | |
NFData (UnixDateTime cal) Source # | |
Random (UnixDateTime Gregorian) Source # | |
Human (UnixDateTime Gregorian) Source # | |
Math (UnixDateTime Gregorian) Second Source # | |
Math (UnixDateTime Gregorian) Minute Source # | |
Math (UnixDateTime Gregorian) Hour Source # | |
Math (UnixDateTime Gregorian) Day Source # | |
type Rep (UnixDateTime cal) Source # | |
type Components (UnixDateTime Gregorian) Source # | |
data UnixDateTimeNanos cal Source #
Nanoseconds since Unix epoch (excluding leap seconds).
Bounded (UnixDateTimeNanos Gregorian) Source # | |
Eq (UnixDateTimeNanos cal) Source # | |
Typeable Calendar cal => Data (UnixDateTimeNanos cal) Source # | |
Ord (UnixDateTimeNanos cal) Source # | |
Show (UnixDateTimeNanos Gregorian) Source # | |
Generic (UnixDateTimeNanos cal) Source # | |
Storable (UnixDateTimeNanos cal) Source # | |
NFData (UnixDateTimeNanos cal) Source # | |
Random (UnixDateTimeNanos Gregorian) Source # | |
Human (UnixDateTimeNanos Gregorian) Source # | |
Math (UnixDateTimeNanos Gregorian) Nanos Source # | |
Math (UnixDateTimeNanos Gregorian) Micros Source # | |
Math (UnixDateTimeNanos Gregorian) Millis Source # | |
Math (UnixDateTimeNanos Gregorian) Second Source # | |
Math (UnixDateTimeNanos Gregorian) Minute Source # | |
Math (UnixDateTimeNanos Gregorian) Hour Source # | |
Math (UnixDateTimeNanos Gregorian) Day Source # | |
type Rep (UnixDateTimeNanos cal) Source # | |
type Components (UnixDateTimeNanos Gregorian) Source # | |
Create
createUnixDate :: Year -> Month Gregorian -> Day -> UnixDate Gregorian Source #
Create a Unix datestamp.
createUnixDateTime :: Year -> Month Gregorian -> Day -> Hour -> Minute -> Second -> UnixDateTime Gregorian Source #
Create a Unix timestamp.
createUnixDateTimeNanos :: Year -> Month Gregorian -> Day -> Hour -> Minute -> Second -> Nanos -> UnixDateTimeNanos Gregorian Source #
Create a Unix timestamp with nanosecond granularity.
Get
getCurrentUnixDate :: IO (UnixDate Gregorian) Source #
Get the current Unix datestamp from the system clock.
getCurrentUnixDateTime :: IO (UnixDateTime Gregorian) Source #
Get the current Unix timestamp from the system clock.
getCurrentUnixDateTimeNanos :: IO (UnixDateTimeNanos Gregorian) Source #
Get the current Unix timestamp with nanosecond granularity from the system clock.
Parse
parseUnixDate :: TimeLocale -> Format -> Text -> Either String (UnixDate Gregorian) Source #
Parse a Unix datestamp.
parseUnixDateTime :: TimeLocale -> Format -> Text -> Either String (UnixDateTime Gregorian) Source #
Parse a Unix timestamp.
parseUnixDateTimeNanos :: TimeLocale -> Format -> Text -> Either String (UnixDateTimeNanos Gregorian) Source #
Parse a Unix timestamp with nanosecond granularity.