hodatime- 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>
Safe HaskellSafe



An LocalTime represents a time of day, with no reference to a particular calendar, time zone or date. This module contains constructors and functions for working with LocalTime.


A clock time can be from 00:00:00.000 to 23:59:59.99.. Adding 1 minute to 23:59:00 will cause it to roll over to 00:00:00.



data LocalTime Source #

Represents a specific time of day with no reference to any calendar, date or time zone.

class HasLocalTime lt where Source #

Minimal complete definition

hour, minute, second, nanosecond


hour :: Functor f => (Hour -> f Hour) -> lt -> f lt Source #

Lens for the hour component of the LocalTime

minute :: Functor f => (Minute -> f Minute) -> lt -> f lt Source #

Lens for the minute component of the LocalTime

second :: Functor f => (Second -> f Second) -> lt -> f lt Source #

Lens for the second component of the LocalTime

nanosecond :: Functor f => (Nanosecond -> f Nanosecond) -> lt -> f lt Source #

Lens for the nanoseconds component of the LocalTime. NOTE: no effort is made to detect nano overflow. They will simply roll over on overflow without affecting the rest of the time.

type Hour = Int Source #

localTime :: Hour -> Minute -> Second -> Nanosecond -> Maybe LocalTime Source #

Create a new LocalTime from an hour, minute, second and nanosecond if values are valid, nothing otherwise