hodatime-0.2.2.1: A fully featured date/time library based on Nodatime
Copyright(C) 2016 Jason Johnson
LicenseBSD-style (see the file LICENSE)
MaintainerJason Johnson <jason.johnson.081@gmail.com>
Stabilityexperimental
PortabilityTBD
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HodaTime.Offset

Description

An Offset is a period of time offset from UTC time. This module contains constructors and functions for working with Offsets.

Clamping

An offset must be between 18 hours and -18 hours (inclusive). If you go outside this range the functions will clamp to the nearest value.

Synopsis

Types

data Offset Source #

An Offset from UTC in seconds.

Instances

Instances details
Show Offset Source # 
Instance details

Defined in Data.HodaTime.Offset.Internal

Eq Offset Source # 
Instance details

Defined in Data.HodaTime.Offset.Internal

Methods

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

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

Ord Offset Source # 
Instance details

Defined in Data.HodaTime.Offset.Internal

Constructors

empty :: Offset Source #

An Offset with an offset of 0. This is equivalent to UTC

fromSeconds :: Integral a => a -> Offset Source #

Create an Offset of (clamped) s seconds.

fromMinutes :: Integral a => a -> Offset Source #

Create an Offset of (clamped) m minutes.

fromHours :: Integral a => a -> Offset Source #

Create an Offset of (clamped) h hours.

Lenses

seconds :: Functor f => (Int -> f Int) -> Offset -> f Offset Source #

Lens for the seconds component of the Offset

minutes :: Functor f => (Int -> f Int) -> Offset -> f Offset Source #

Lens for the minutes component of the Offset

hours :: Functor f => (Int -> f Int) -> Offset -> f Offset Source #

Lens for the hours component of the Offset

Math

addClamped :: Offset -> Offset -> Offset Source #

Add one Offset to another NOTE: if the result of the addition is outside the accepted range it will be clamped

minusClamped :: Offset -> Offset -> Offset Source #

Subtract one Offset to another. NOTE: See add above