-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | date time -- -- pico precision * timestamps * timezones @package hora @version 2.0 module Data.Time.Hora.Type -- | serializeable structure for essential Date, Time parts -- -- see Data.Time.Hora.Part for conversion between UTCTime -- and DatePart 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 -- | Tz (DatePart a) parts show local date & time -- -- for conversions between timezones see Data.Time.Hora.Zone data Tz a Tz :: TimeZone -> a -> Tz a -- | TimeZone | TimeZoneSeries class Tz' tz tz' :: Tz' tz => tz -> UTCTime -> TimeZone -- | second and fractions -- -- see Data.Time.Hora.Span for conversion data TimeSpan a Sec :: a -> TimeSpan a Pico :: a -> TimeSpan a Milli :: a -> TimeSpan a -- | constraint type TwoInt a b = (Integral a, Integral b) instance GHC.Base.Functor Data.Time.Hora.Type.TimeSpan instance GHC.Show.Show a => GHC.Show.Show (Data.Time.Hora.Type.TimeSpan a) instance GHC.Base.Functor Data.Time.Hora.Type.Tz instance GHC.Show.Show a => GHC.Show.Show (Data.Time.Hora.Type.Tz a) instance GHC.Generics.Generic (Data.Time.Hora.Type.DatePart a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Time.Hora.Type.DatePart a) instance GHC.Show.Show a => GHC.Show.Show (Data.Time.Hora.Type.DatePart a) instance GHC.Base.Functor Data.Time.Hora.Type.DatePart instance Data.Binary.Class.Binary (Data.Time.Hora.Type.DatePart GHC.Types.Int) instance Data.Binary.Class.Binary (Data.Time.Hora.Type.DatePart GHC.Integer.Type.Integer) instance Data.Binary.Class.Binary (Data.Time.Hora.Type.DatePart GHC.Base.String) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Time.Hora.Type.DatePart a) instance Data.Time.Hora.Type.Tz' Data.Time.LocalTime.TimeZone.TimeZone instance Data.Time.Hora.Type.Tz' Data.Time.LocalTime.TimeZone.Series.TimeZoneSeries instance GHC.Real.Integral a => GHC.Num.Num (Data.Time.Hora.Type.TimeSpan a) instance (GHC.Classes.Eq a, GHC.Real.Integral a) => GHC.Classes.Eq (Data.Time.Hora.Type.TimeSpan a) instance (GHC.Classes.Ord a, GHC.Real.Integral a) => GHC.Classes.Ord (Data.Time.Hora.Type.TimeSpan a) module Data.Time.Hora.Format -- | *0: 0 padded -- -- see formatTime data Format Raw :: String -> Format Tab :: Format -- | new line Crlf :: Format -- | time zone Offset :: Format -- | time zone name Zone :: Format -- | %H:%M Hm :: Format -- | %H:%M:%S Hms :: Format -- | AM PM AM :: Format -- | am pm Am :: Format -- | 24-hour *0 H_24 :: Format -- | 12-hour *0 H_12 :: Format -- | minute *0 Min :: Format -- | second *0 S :: Format -- | pico precision *0 Fraction_fixed :: Format -- | .12 for 0.12 second. Pico precision, no trailing 0 Fraction :: Format -- | %Y-%m-%d Y_m_d :: Format -- | year Y :: Format -- | month name long Month :: Format -- | month name short Mth :: Format -- | month *0 Mth_1_12 :: Format -- | day *0 D :: Format -- | day of week for Week Date format, 1 - 7 D_wk_1_7 :: Format -- | day of week number, 0 (= Sunday) - 6 (= Saturday) D_wk_0_6 :: Format -- | day of week short D_wk :: Format -- | day of week long D_week :: Format -- | week of year start sunday Wk_year_Sun :: Format -- | week of year start sunday Wk_year_Mon :: Format -- | format as UTC format :: [Format] -> UTCTime -> String -- | format as local time in specified timezone format' :: Tz' tz => [Format] -> tz -> UTCTime -> Tz String instance Data.String.IsString Data.Time.Hora.Format.Format instance Data.Time.Hora.Format.Build [Data.Time.Hora.Format.Format] instance Data.Time.Hora.Format.Build Data.Time.Hora.Format.Format -- | common format shortcuts module Data.Time.Hora.Some -- | yyyy-mm-dd iso :: [Format] -- | yyyymmdd ymd :: [Format] -- | time.fraction no trailing 0 - varying length -- -- 09:10:58.030311306 tf :: [Format] -- | time -- -- 09:11:18 t :: [Format] -- | date, time -- -- 2016-12-14 09:16:23 dt :: [Format] module Data.Time.Hora.Span -- |
-- >>> 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 -- | pico in 1 second picoSec :: Integral a => a -- | pico in 1 milli picoMs :: Integral a => a -- | milli in 1 sec msSec :: Integral a => a picoTimeSpan :: Integral a => Pico -> TimeSpan a timeSpanPico :: Integral a => TimeSpan a -> Pico toDiffTime :: Integral a => TimeSpan a -> DiffTime nominalDiff :: Integral a => TimeSpan a -> NominalDiffTime 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.Span 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 -- | convert between UTCTime and DatePart module Data.Time.Hora.Part -- | UTC fromUtc :: Integral a => UTCTime -> DatePart a -- | specified time zone -- -- Tz (DatePart a) parts show local date & time -- -- see also Data.Time.Hora.Zone fromUtc' :: (Tz' tz, Integral a) => tz -> UTCTime -> Tz (DatePart a) -- | convert DatePart -> UTCTime -- -- Invalid date returns Nothing class ToUTC a toUtc :: ToUTC a => a -> Maybe UTCTime instance GHC.Real.Integral a => Data.Time.Hora.Part.ToUTC (Data.Time.Hora.Type.DatePart a) instance GHC.Real.Integral a => Data.Time.Hora.Part.ToUTC (Data.Time.Hora.Type.Tz (Data.Time.Hora.Type.DatePart a)) module Data.Time.Hora.Stamp -- | numeric class Now a now :: Now a => IO a -- | timestamp in specified format -- -- see Data.Time.Hora.Some for common [Format]s class Timestamp out ts :: Timestamp out => [Format] -> IO out -- | timestamp in specified format, TimeZone | -- TimeZoneSeries ts' :: Tz' tz => [Format] -> tz -> IO (Tz String) instance GHC.Real.Integral a => Data.Time.Hora.Stamp.Now (Data.Time.Hora.Type.DatePart a) instance Data.Time.Hora.Stamp.Now Data.Time.Clock.UTC.UTCTime instance GHC.Real.Integral a => Data.Time.Hora.Stamp.Now (Data.Time.Hora.Type.Tz (Data.Time.Hora.Type.DatePart a)) instance Data.Time.Hora.Stamp.Timestamp GHC.Base.String instance Data.Time.Hora.Stamp.Timestamp (Data.Time.Hora.Type.Tz GHC.Base.String) -- | to get timezone-series data, see timezone-olson -- -- see also timezone-series -- -- for complete example with olson, see Test.TestZone in this package -- --
-- import Data.Time.LocalTime.TimeZone.Olson -- -- -- see man tzfile for common olson file locations -- getTimeZoneSeriesFromOlsonFile "/usr/share/zoneinfo/Chile/Continental" >>= -- \(chile1::TimeZoneSeries) -> ... --module Data.Time.Hora.Zone -- | convert a to b in specified TimeZone class ToTimeZone a b toTimeZone :: ToTimeZone a b => TimeZoneSeries -> a -> b -- | similar to fromUtc' but safer around dates when e.g. Summer -- time changes -- | convert DatePart from one TimeZone to another instance GHC.Real.Integral a => Data.Time.Hora.Zone.ToTimeZone Data.Time.Clock.UTC.UTCTime (Data.Time.Hora.Type.Tz (Data.Time.Hora.Type.DatePart a)) instance GHC.Real.Integral a => Data.Time.Hora.Zone.ToTimeZone (Data.Time.Hora.Type.Tz (Data.Time.Hora.Type.DatePart a)) (GHC.Base.Maybe (Data.Time.Hora.Type.Tz (Data.Time.Hora.Type.DatePart a)))