Timespan values

The Reevaluate() action and historical data functions (if available) allow you to enter Timespan values. By default, timespan values are read by the Platform as a number of minutes. You can identify the value as hours, days, weeks, months, or seconds, using the appropriate letter. When you specify a timespan with a letter, make sure that you use the double quotation marks, as shown in the following example:

Reevaluate("60s")

This example re-evaluates the rule in 60 seconds. If you do not use the double quotation marks or letter, the Platform treats the entry as an absolute time (in seconds).

You can specify a calculation as a timespan or a string (using letters) as a timespan. For example, to specify a timespan of 12 hours, you can define "720m" or 60*12 or "12h". The Platform reads each of these as 12 hours.

Examples of use:

X*Y - defines the calculated value as the timespan (where X and Y can be any value)

"Nm" - N minutes

"Nh" - N hours

"Nd" - N days

"Nw" - N weeks

"Nmo" - N months

If enabled for your Platform, certain historical data functions require you to provide a timespan. For example, Array GetData(String dataitem, Number timespan) and Array GetMobileLocation(Number timespan, Number max) require you to provide values for the "timespan" parameter. The functions that use timespan are GetData(), GetDataForDevice(), GetMobileLocation(), and GetMobileLocationForDevice().

Note: You need to keep in mind that, though you may have defined the function correctly and the Platform may have run the function as defined, the Platform only finds, reads, or returns the data (alarms, messages, and so on) that were posted during the defined timespan. If no data was posted during a specified timespan, no data is returned.