Nexial Automation

Test Automation Platform for everyone!

X

$(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  yesterdaytomorrownext quarterfirst 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 epoch to signify the display of date/time value in its epoch value (millisecond).
  • informal to express date/time information in a colloquial, non-exact manner that mimic human conversation. For example, informal format would output about a minute ago instead of 00:00:57, or about a month and a half ago rather than 2018/08/24 00:01:32. The informal format is suitable to use in conjunction with the sound » speak(text) command.
  • base10time to express time information as a base-10 decimal number. For example, 10:25:30 would be converted as 10.425, 14.32918 would be converted as 14: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

Output


$(sysdate|today|format)

same as $(sysdate|now|format), kept alive for backward compatibility.

Example

  • Script
  • Output

$(sysdate|yesterday|format)

Render yesterday (more precisely, exactly 24 hours ago) using the specified format.

Example

  • Script
  • Output

$(sysdate|tomorrow|format)

Render tomorrow (more precisely, exactly 24 hours later) using the specified format.

Example

  • Script
  • Output

$(sysdate|currentQtr|format)

Render the current quarter using the specified format.  Only year and quarter information would be rendered here.

Example
Script

Output


$(sysdate|lastQtr|format)

Render the last quarter using the specified format.  Only year and quarter information would be rendered here.

Example
Script

Output


$(sysdate|nextQtr|format)

Render the next quarter using the specified format.  Only year and quarter information would be rendered here.

Example
Script

Output


$(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

Output


$(sysdate|lastDOM|format)

render the last day of the month using specified format.

Example
Script

Output


$(sysdate|firstDOW|format)

render the first day of the week using specified format.

Example
Script

Output


$(sysdate|lastDOW|format)

render the last day of the week using specified format.

Example
Script

Output


See Also