rethinkdb-1.8.0.5: RethinkDB driver for Haskell

Safe HaskellNone

Database.RethinkDB.Time

Synopsis

Documentation

now :: ReQLSource

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 -> ReQLSource

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 -> ReQLSource

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 -> ReQLSource

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 -> ReQLSource

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 -> ReQLSource

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

timezone :: Expr time => time -> ReQLSource

Extract part of a time value

seconds :: Expr time => time -> ReQLSource

Extract part of a time value

minutes :: Expr time => time -> ReQLSource

Extract part of a time value

hours :: Expr time => time -> ReQLSource

Extract part of a time value

dayOfYear :: Expr time => time -> ReQLSource

Extract part of a time value

dayOfWeek :: Expr time => time -> ReQLSource

Extract part of a time value

day :: Expr time => time -> ReQLSource

Extract part of a time value

month :: Expr time => time -> ReQLSource

Extract part of a time value

year :: Expr time => time -> ReQLSource

Extract part of a time value

timeOfDay :: Expr time => time -> ReQLSource

Extract part of a time value

date :: Expr time => time -> ReQLSource

Extract part of a time value

toIso8601 :: Expr t => t -> ReQLSource

Convert a time to another representation

toEpochTime :: Expr t => t -> ReQLSource

Convert a time to another representation

newtype UTCTime Source

Time with no time zone

The default FromJSON instance for Data.Time.UTCTime is incompatible with ReQL's time type

Constructors

UTCTime UTCTime 

newtype ZonedTime Source

Time with a time zone

The default FromJSON instance for Data.Time.ZonedTime is incompatible with ReQL's time type

Constructors

ZonedTime ZonedTime