Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
themeConfluence
languagejavascript
convertToUTC = function(dt) {
  time:strftime(dt, "%Y%m%dT%H%M%S%z", {"tz":"UTC"})
};

 

time:atom()

time:atom() - converts a datetime string to an ATOM compatible form.

Code Block
themeConfluence
languagejavascript
time:atom("2010-10-31")        # 2010-10-31T00:00:00Z
time:atom("2010-10-31",{       # 2010-10-31T06:00:00Z
    "tz" : "America/Denver"
})

Time Predicates

All of the following predicates are referenced to the user's local time. These predicates depend on knowing timezone context for the event or query that causes them to run. The timezone context can be specified via a reserved event attribute, _timezone. If _timezone is not specified for an event UTC is used. 

All times are 24-hour clock. All  

All predicates must be preceded by the modules name, for example:

...

Code Block
themeConfluence
languagejavascript
 rule glee_check {
   select when pageview ".*"
   if (time:timezone("MST")) then {
     notify("Glee alert", "Glee starts at 7pm");
   }
 }

daytime

time:daytime() - returns true if it is between sunrise and sunset, otherwise returns false.

nighttime

...

morning

time:morning() - returns true if it is between 0600 and 1200 hours, otherwise returns false.

...