$(sysdate)
Description
Not to be confused with another built-in function, $(date), which can be used to manipulate dates and time
(i.e date math). This built-in function focuses on system dates, from the perspective of the test machine
(where tests are executed). It also use test machine system date to render other relative date information such as
yesterday, tomorrow, next quarter, first day of the month, etc.
Date Format
For date/time formatting (denoted below as format or *Format), Nexial supports the following 3 conventions:
- Standard Java date/time formatting convention for a full range to express the desired date/time format.
- epoch
for timestamp. Use
epochto signify the display of date/time value in its epoch value (millisecond). informalto express date/time information in a colloquial, non-exact manner that mimic human conversation. For example,informalformat would outputabout a minute agoinstead of00:00:57, orabout a month and a half agorather than2018/08/24 00:01:32. Theinformalformat is suitable to use in conjunction with the sound »speak(text)command.base10timeto express time information as a base-10 decimal number. For example,10:25:30would be converted as10.425,14.32918would be converted as14:19:46.
In cases where only year and quarter information should be considered, use yfor year and q for quarter information.
For example, $(sysdate|lastQtr|yyyy-q) will render the last quarter in the format of “4_digit_year-quarter”.
Available Functions
$(sysdate|now|format)
Render the current date/time using the specified format. For formatting timestamp, use the format like
this: $(sysdate|now|epoch).
Example
Script
_03.png)
Output
_04.png)
$(sysdate|today|format)
same as $(sysdate|now|format), kept alive for backward compatibility.
Example
- Script
_05.png)
- Output
_06.png)
$(sysdate|yesterday|format)
Render yesterday (more precisely, exactly 24 hours ago) using the specified format.
Example
- Script
_07.png)
- Output
_08.png)
$(sysdate|tomorrow|format)
Render tomorrow (more precisely, exactly 24 hours later) using the specified format.
Example
- Script
_09.png)
- Output
_10.png)
$(sysdate|currentQtr|format)
Render the current quarter using the specified format. Only year and quarter information would be rendered here.
Example
Script
_11.png)
Output
_12.png)
$(sysdate|lastQtr|format)
Render the last quarter using the specified format. Only year and quarter information would be rendered here.
Example
Script
_13.png)
Output
_14.png)
$(sysdate|nextQtr|format)
Render the next quarter using the specified format. Only year and quarter information would be rendered here.
Example
Script
_15.png)
Output
_16.png)
$(sysdate|firstDOM|format)
Render the first day of the month using specified format. For formatting timestamp, use the format like
this: $(sysdate|firstDOM|epoch).
Example
Script
_17.png)
Output
_18.png)
$(sysdate|lastDOM|format)
render the last day of the month using specified format.
Example
Script
_19.png)
Output
_20.png)
$(sysdate|firstDOW|format)
render the first day of the week using specified format.
Example
Script
_21.png)
Output
_22.png)
$(sysdate|lastDOW|format)
render the last day of the week using specified format.
Example
Script
_23.png)
Output
_24.png)