Safe Haskell | None |
---|---|
Language | Haskell98 |
- now :: ReQL
- time :: ReQL -> ReQL -> ReQL -> ReQL -> ReQL -> ReQL -> ReQL -> ReQL
- epochTime :: ReQL -> ReQL
- iso8601 :: ReQL -> ReQL
- inTimezone :: Expr time => ReQL -> time -> ReQL
- during :: (Expr left, Expr right, Expr time) => Bound left -> Bound right -> time -> ReQL
- timezone :: Expr time => time -> ReQL
- seconds :: Expr time => time -> ReQL
- minutes :: Expr time => time -> ReQL
- hours :: Expr time => time -> ReQL
- dayOfYear :: Expr time => time -> ReQL
- dayOfWeek :: Expr time => time -> ReQL
- day :: Expr time => time -> ReQL
- month :: Expr time => time -> ReQL
- year :: Expr time => time -> ReQL
- timeOfDay :: Expr time => time -> ReQL
- date :: Expr time => time -> ReQL
- toIso8601 :: Expr t => t -> ReQL
- toEpochTime :: Expr t => t -> ReQL
- newtype UTCTime = UTCTime UTCTime
- timeToDouble :: UTCTime -> Double
- doubleToTime :: Double -> UTCTime
- newtype ZonedTime = ZonedTime ZonedTime
- parseTimeZone :: String -> Parser TimeZone
Documentation
The time and date when the query is executed
>>> run h $ now :: IO (Maybe R.ZonedTime) Just 2013-10-28 00:01:43.930000066757 +0000
time :: ReQL -> ReQL -> ReQL -> ReQL -> ReQL -> ReQL -> ReQL -> ReQL Source
Build a time object from the year, month, day, hour, minute, second and timezone fields
>>> run h $ time 2011 12 24 23 59 59 "Z" :: IO (Maybe R.ZonedTime) Just 2011-12-24 23:59:59 +0000
epochTime :: ReQL -> ReQL Source
Build a time object given the number of seconds since the unix epoch
>>> run h $ epochTime 1147162826 :: IO (Maybe R.ZonedTime) Just 2006-05-09 08:20:26 +0000
iso8601 :: ReQL -> ReQL Source
Build a time object given an iso8601 string
>>> run h $ iso8601 "2012-01-07T08:34:00-0700" :: IO (Maybe R.UTCTime) Just 2012-01-07 15:34:00 UTC
inTimezone :: Expr time => ReQL -> time -> ReQL Source
The same time in a different timezone
>>> run h $ inTimezone "+0800" now :: IO (Maybe R.ZonedTime) Just 2013-10-28 08:16:39.22000002861 +0800
during :: (Expr left, Expr right, Expr time) => Bound left -> Bound right -> time -> ReQL Source
Test if a time is between two other times
>>> run h $ during (Open $ now - (60*60)) (Closed now) $ epochTime 1382919271 :: IO (Maybe Bool) Just True
toEpochTime :: Expr t => t -> ReQL Source
Convert a time to another representation
Time with no time zone
The default FromJSON instance for Data.Time.UTCTime is incompatible with ReQL's time type
timeToDouble :: UTCTime -> Double Source
doubleToTime :: Double -> UTCTime Source
Time with a time zone
The default FromJSON instance for Data.Time.ZonedTime is incompatible with ReQL's time type
parseTimeZone :: String -> Parser TimeZone Source