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
- date :: Expr time => time -> ReQL
- timeOfDay :: Expr time => time -> ReQL
- year :: Expr time => time -> ReQL
- month :: Expr time => time -> ReQL
- day :: Expr time => time -> ReQL
- dayOfWeek :: Expr time => time -> ReQL
- dayOfYear :: Expr time => time -> ReQL
- hours :: Expr time => time -> ReQL
- minutes :: Expr time => time -> ReQL
- seconds :: Expr time => time -> ReQL
- toIso8601 :: Expr t => t -> ReQL
- toEpochTime :: Expr t => t -> ReQL
Documentation
>>>
:set -XOverloadedStrings
>>>
:load Database.RethinkDB.NoClash
>>>
import qualified Database.RethinkDB as R
>>>
import Database.RethinkDB.NoClash
>>>
import Prelude
>>>
h <- connect "localhost" 28015 def
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"
Time<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
Time<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"
Time<2012-01-07 08:34:00 -0700>
inTimezone :: Expr time => ReQL -> time -> ReQL Source #
The same time in a different timezone
>>>
_ <- run' h $ inTimezone "+0800" now
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 R.- (60*60)) (Closed now) $ epochTime 1382919271
false
toEpochTime :: Expr t => t -> ReQL Source #
Convert a time to another representation