Current Date Tags

The default-current-date or current-date tag at the beginning of the factory configuration file specifies the date on which the data is current. Time series calculations, such as year-to-date, use this date as the anchor date.

You can use a fixed date or take a date from a file. A format tag is also accepted.

For example:

  • default-current-date "2021/04/19"
  • default-current-date from-file="current-date.txt"

The from-file example expects the text file to be in the factory project's config directory. If you are setting the date from a text file, ensure that the process for creating that text file is in place.

TIP: You can retrieve this date in a Spectre expression using the current_date() function as shown in the following example:

     filter `value("Date") != null and value("Date") <= current_date()`

Current Date Tags

Tags Examples Notes
default-current-date default-current-date "2019/05/11"

Declares a fixed date as the build date for the factory. This date indicates the data is complete as of this date.

Sets the date for the factory build such that it matches the date in DivePort used as the current date for time series and QuickViews.

from-file

default-current-date from-file="current-date.txt"

Obtains the date from a text file located in the factory project's config directory.
format

default-current-date "2019/05/12" format="YYYY/MM/DD"

default-current-date from-file="current-date.txt" format="YYYY-MM-DD"

Sets the date format.
maximum

default-current-date from-file="current-date.txt" format="YYYY/MM/DD" {

maximum "2020/01/01"

}

Defines a maximum value for the current date.
minimum

default-current-date from-file="current-date.txt" format="YYYY/MM/DD" {

minimum "2000/01/01"

maximum from-file="date-range-end.txt"

}

Defines a minimum value for the current date.
take-parameter

take-parameter "Factory Date"

default-current-date "$(Factory Date)"

Declares a build-time parameter used in the factory. Allows you to set the current date using the parameter's value.