penny-lib-0.2.0.0: Extensible double-entry accounting system - library

Safe HaskellSafe-Infered

Penny.Lincoln.Bits.DateTime

Description

Perhaps this could be called moment, as it aims to identify a moment in time. A DateTime is a combination of a LocalTime from Data.Time and a TimeZoneOffset. Previously a DateTime was simply a ZonedTime from Data.Time but ZonedTime has data that Penny does not need.

Synopsis

Documentation

data DateTime Source

A DateTime is a UTC time that also remembers the local time from which it was set. The Eq and Ord instances will compare two DateTimes based on their equivalent UTC times.

dateTime :: LocalTime -> TimeZoneOffset -> DateTimeSource

Construct a DateTime.

data TimeZoneOffset Source

The number of minutes that this timezone is offset from UTC. Can be positive, negative, or zero.

minsToOffset :: Int -> Maybe TimeZoneOffsetSource

Convert minutes to a time zone offset. I'm having a hard time deciding whether to be liberal or strict in what to accept here. Currently it is somewhat strict in that it will fail if absolute value is greater than 840 minutes; currently the article at http:en.wikipedia.orgwikiList_of_time_zones_by_UTC_offset says there is no offset greater than 14 hours, or 840 minutes.