hodatime-0.1.1.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
LanguageHaskell2010

Data.HodaTime.Offset

Contents

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.

Constructors

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

add :: 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

minus :: Offset -> Offset -> Offset Source #

Subtract one Offset to another. NOTE: See add above