Current Date Tags
The
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 |
---|---|---|
current-date | current-date "2019/05/12" |
Declares a fixed date as the build date for the factory. This date indicates the data is complete as of this date. NOTE: This tag is deprecated in Workbench 7.1(6)—use default-current-date instead. If the factory config script uses the current-date tag, the built factory moves that date back by one day. For example, if you set current-date to "2019/08/23" in the factory script, the DivePort Current Date QuickView defaults to "2019/08/22". With the 7.1(6) time series changes, this results in the same data being displayed as in previous versions. |
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. TIP: When using version 7.1(6) or later, replace the current-date tag with default-current-date, and move the date one day back. For instance, if you generate a current-date file containing the day of the build, change the process so that it generates a current-date file containing the day before the day of the build. |
from-file |
|
Obtains the date from a text file located in the factory project's config directory. |
format |
|
Sets the date format. |
maximum |
maximum "2020/01/01" } |
Defines a maximum value for the current date. |
minimum |
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. |