@hackage lens-datetime0.1

Lenses for Data.Time.* types

The lens-datetime library provides a unified lens based accessors to the various types in Data.Time.Clock, Data.Time.Calendar and Data.Time.LocalTime.

Demonstration of basic uses.

import Control.Lens
import Data.Time
import Data.Time.Lens

aDay :: Day
aDay = fromGregorian 2013 08 22

aLocal :: LocalTime
aLocal = LocalTime aDay (TimeOfDay 13 45 28)

aUTC :: UTCTime
aUTC = UTCTime aDay 7458.9

You can then do the following:

>>>>>>>>>>>>

You can manipulate the date-time values with proper roll-over behavior via the FlexibleDateTime mechanism:

>>>>>>>>>>>>