postgresql-types
Safe HaskellNone
LanguageHaskell2010

PostgresqlTypes.Timetz

Synopsis

Documentation

data Timetz Source #

PostgreSQL timetz type. Time of day with time zone.

Stored as microseconds since midnight and time zone offset in seconds.

Low value: 00:00:00+1559. High value: 24:00:00-1559.

PostgreSQL docs.

Instances

Instances details
Arbitrary Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Eq Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Methods

(==) :: Timetz -> Timetz -> Bool #

(/=) :: Timetz -> Timetz -> Bool #

Ord Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

IsString Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Methods

fromString :: String -> Timetz #

Read Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Show Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Hashable Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Methods

hashWithSalt :: Int -> Timetz -> Int #

hash :: Timetz -> Int #

IsScalar Timetz Source # 
Instance details

Defined in PostgresqlTypes.Timetz

Accessors

toTimeInMicroseconds :: Timetz -> Int64 Source #

Extract time in microseconds since midnight.

toTimeZoneInSeconds :: Timetz -> Int32 Source #

Extract time zone offset in seconds.

toTimeOfDay :: Timetz -> TimeOfDay Source #

Extract time of day.

normalizeToTimeZone :: Timetz -> TimeZone Source #

Extract time zone rounding the offset in seconds to the nearest minute, because that's the precision supported by TimeZone.

refineToTimeZone :: Timetz -> Maybe TimeZone Source #

Try to extract time zone, failing if the offset in seconds is not a multiple of 60.

Constructors

normalizeFromTimeInMicrosecondsAndOffsetInSeconds :: Int64 -> Int32 -> Timetz Source #

Construct Timetz from time in microseconds since midnight and time zone offset in seconds, clamping the out of range values.

normalizeFromTimeOfDayAndTimeZone :: TimeOfDay -> TimeZone -> Timetz Source #

Construct Timetz from TimeOfDay and TimeZone, clamping the out of range values.

refineFromTimeInMicrosecondsAndOffsetInSeconds :: Int64 -> Int32 -> Maybe Timetz Source #

Try to construct Timetz from time in microseconds since midnight and time zone offset in seconds, failing if out of range.

refineFromTimeOfDayAndTimeZone :: TimeOfDay -> TimeZone -> Maybe Timetz Source #

Try to construct Timetz from TimeOfDay and TimeZone, failing if out of range.