Skip to content

NovaStar Core / Program Parameter Reference / interval


Overview

The interval program parameter is used to set a length of time. It internally is calculated as a number of seconds, which can be added to time stamps to shift the time.

It is used in many different programs, for example to indicate:

  • the interval for regular interval time series output from an analysis
  • an interval to be added or subtracted from a period start/end, when specifying a period to process
  • a time shift to be applied to data reports

In the statparm parameter type, interval is used to set the analysis interval, display interval, and time offset.

Program Parameter Syntax

The most common parameter value is a numerical multiplier and time units, for example 1hour, where the multiplier is typically an integer when indicating a time series interval, and can be a floating point number.

The syntax follows these rules:

  • Starts with one of *-.+01234567890/\ TODO what are / and \ used for?
  • This first character should be part of a valid floating point number.
  • After the floating point number, there can be any combination and number of any digit, -, ., and +.
  • Then there can be any number of spaces.
  • Then optionally a unit string from the Time Units table, below. The string "1hour" and "1 hour" are equivalent, although command line parameters may require the former to avoid issues parsing the command line.

Time units are converted to internal equivalents as seconds. Because months have different lengths, month and year represented as an interval is approximate.

The parameter value can be one of the following special cases:

  • once: Equivalent to 0 seconds.
  • forever: Equivalent to the largest time value that can be stored.
  • never: Creates an error condition (?).

Time Units

Time units are strings that indicate the base date/time unit for an interval. Single characters are used in command parameters. Longer strings are used for clarity and formatting output.

TODO shouldn't 1 be for seconds and zero or a negative number indicate none? Need to add seconds below.

String Multiplier for Seconds Equivalent
wateryear 31536001
y
year
31536000
month
months
2678400
d
day
days
86400
h
hour
hours
3600
m
month
months
60
None 1

Examples

The following are examples of valid interval strings. TODO need more examples of the other cases, such as floating point with other characters.

  • 5minutes: Results in 300 seconds.
  • 1hour: Results in 3600 seconds.
  • 1day: Results in a time of 86400 seconds.
  • 2days: Results in a time of 172800 seconds.
  • 1month: Results in a time of 2678400 seconds.