-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | date time -- -- date time functions to pico precision @package hora @version 1.1 module Data.Time.Hora.Type.DatePart -- | Date, Time parts data DatePart a DatePart :: a -> a -> a -> a -> a -> a -> a -> DatePart a [year] :: DatePart a -> a [month] :: DatePart a -> a [day] :: DatePart a -> a [hour] :: DatePart a -> a [minute] :: DatePart a -> a [second] :: DatePart a -> a -- | excludes seconds. Just fraction as Num [pico] :: DatePart a -> a instance GHC.Generics.Generic (Data.Time.Hora.Type.DatePart.DatePart a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Time.Hora.Type.DatePart.DatePart a) instance GHC.Show.Show a => GHC.Show.Show (Data.Time.Hora.Type.DatePart.DatePart a) instance GHC.Base.Functor Data.Time.Hora.Type.DatePart.DatePart instance Data.Binary.Class.Binary (Data.Time.Hora.Type.DatePart.DatePart GHC.Types.Int) instance Data.Binary.Class.Binary (Data.Time.Hora.Type.DatePart.DatePart GHC.Base.String) instance GHC.Classes.Ord (Data.Time.Hora.Type.DatePart.DatePart GHC.Types.Int) module Data.Time.Hora.Type.Time data Tz a Tz :: TimeZone -> a -> Tz a -- | constraint type TwoInt a b = (Integral a, Integral b) -- | various precision data TimeSpan a Sec :: a -> TimeSpan a Pico :: a -> TimeSpan a Milli :: a -> TimeSpan a instance GHC.Base.Functor Data.Time.Hora.Type.Time.TimeSpan instance GHC.Show.Show a => GHC.Show.Show (Data.Time.Hora.Type.Time.TimeSpan a) instance GHC.Base.Functor Data.Time.Hora.Type.Time.Tz instance GHC.Show.Show a => GHC.Show.Show (Data.Time.Hora.Type.Time.Tz a) instance GHC.Real.Integral a => GHC.Num.Num (Data.Time.Hora.Type.Time.TimeSpan a) instance (GHC.Classes.Eq a, GHC.Real.Integral a) => GHC.Classes.Eq (Data.Time.Hora.Type.Time.TimeSpan a) instance (GHC.Classes.Ord a, GHC.Real.Integral a) => GHC.Classes.Ord (Data.Time.Hora.Type.Time.TimeSpan a) module Data.Time.Hora.Format -- | yyyy-mm-dd UTC iso :: UTCTime -> String -- | yyyy-mm-dd local iso' :: TimeZone -> UTCTime -> Tz String -- | yyyymmdd UTC ymd :: UTCTime -> String -- | yyyymmdd local ymd' :: TimeZone -> UTCTime -> Tz String formatUTCTime :: String -> UTCTime -> String module Data.Time.Hora.Parse -- | UTC parse :: Num a => UTCTime -> DatePart a -- | specified time zone parse' :: Num a => TimeZone -> UTCTime -> Tz (DatePart a) module Data.Time.Hora.Timestamp -- | UTC -- --
-- >>> now
-- DatePart {year = 2016, month = 12, day = 14, hour = 9, minute = 7, second = 10, pico = 233275605000}
--
now :: IO (DatePart Int)
-- | current timezone
--
--
-- >>> now'
-- Tz CET (DatePart {year = 2016, month = 12, day = 14, hour = 10, minute = 7, second = 26, pico = 498313115000})
--
now' :: IO (Tz (DatePart Int))
-- | time UTC
--
-- -- >>> t -- 09:11:18 --t :: IO String -- | time.fraction UTC -- --
-- >>> tf -- 09:10:58.030311306 --tf :: IO String -- | date, time UTC -- --
-- >>> dt -- "2016-12-14 09:16:23" --dt :: IO String -- | date yyyymmdd -- -- UTC -- --
-- >>> d -- "20161214" --d :: IO String -- | date yyyymmdd -- -- local timezone -- --
-- >>> d' -- Tz CET "20161214" --d' :: IO (Tz String) module Data.Time.Hora.Convert -- |
-- >>> toPico $ Milli 3 -- 3000000000 --toPico :: TwoInt a b => TimeSpan a -> b -- |
-- >>> toMilli $ Sec 5 -- 5000 --toMilli :: TwoInt a b => TimeSpan a -> b -- |
-- >>> toSec $ Milli 781200 -- 781 --toSec :: TwoInt a b => TimeSpan a -> b picoTimeSpan :: Num a => Pico -> TimeSpan a timeSpanPico :: Integral a => TimeSpan a -> Pico toDiffTime :: Integral a => TimeSpan a -> DiffTime nominalDiff :: Integral a => TimeSpan a -> NominalDiffTime -- | pico in 1 second picoSec :: Integral a => a -- | pico in 1 milli picoMs :: Integral a => a -- | milli in 1 sec msSec :: Integral a => a module Data.Time.Hora.Future -- | getCurrentTime +/- offset -- -- from unit test: -- --
-- getCurrentTime -- futureUTCTime $ Milli 100 -- futureUTCTime $ Sec 3 -- -- 2016-12-12 15:34:03.138798524 UTC -- 2016-12-12 15:34:03.23893359 UTC -- 2016-12-12 15:34:06.138978355 UTC --futureUTCTime :: Integral a => TimeSpan a -> IO UTCTime -- | Difference between times with pico precision -- -- return TimeSpan for ease of conversion with -- Data.Time.Hora.Convert class PicoDiff a (-) :: PicoDiff a => a -> a -> TimeSpan Integer -- | assuming both times are in the same date. Day part is discarded instance Data.Time.Hora.Future.PicoDiff Data.Time.Clock.UTC.UTCTime instance Data.Time.Hora.Future.PicoDiff Data.Fixed.Pico