hodatime
Copyright(C) 2016 Jason Johnson
LicenseBSD-style (see the file LICENSE)
MaintainerJason Johnson <jason.johnson.081@gmail.com>
Stabilityexperimental
PortabilityPOSIX, Windows
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HodaTime.Instant

Description

An Instant is universal fixed moment in time.

Synopsis

Types

data Instant Source #

Represents a point on a global time line. An Instant has no concept of time zone or calendar. It is nothing more than the number of nanoseconds since epoch (1.March.2000)

Instances

Instances details
Show Instant Source #

A debug rendering exposing the internal epoch-relative fields (epoch is 1.March.2000). There is no clean total constructor to reproduce an arbitrary Instant, so this is deliberately a labelled view, not a call.

Instance details

Defined in Data.HodaTime.Instant.Internal

NFData Instant Source # 
Instance details

Defined in Data.HodaTime.Instant.Internal

Methods

rnf :: Instant -> () #

Eq Instant Source # 
Instance details

Defined in Data.HodaTime.Instant.Internal

Methods

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

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

Ord Instant Source # 
Instance details

Defined in Data.HodaTime.Instant.Internal

Hashable Instant Source # 
Instance details

Defined in Data.HodaTime.Instant.Internal

Methods

hashWithSalt :: Int -> Instant -> Int #

hash :: Instant -> Int #

Constructors

fromSecondsSinceUnixEpoch :: Int -> Instant Source #

Create an Instant from an Int that represents a Unix Epoch

The current time as an Instant.

Note: Hoda Time does not model leap seconds, so now follows POSIX time semantics — the returned Instant does not include leap seconds (every day is treated as exactly 86400 seconds). This keeps now consistent with the rest of the library: round-tripping through a ZonedDateTime never adds or removes leap seconds.

Math

add :: Instant -> Duration -> Instant Source #

Add a Duration to an Instant to get a future Instant.

difference :: Instant -> Instant -> Duration Source #

Get the difference between two instances

minus :: Instant -> Duration -> Instant Source #

Subtract a Duration from an Instant to get an Instant in the past.

Conversion

inTimeZone :: IsCalendarDateTime cal => Instant -> TimeZone -> ZonedDateTime cal Source #

Convert Instant to a ZonedDateTime in the specified time zone. The calendar must be derivable or specified in the type explicitly