Skip to content

SET

FUNCTION

This command sets the date and time or assigns a formatted date and time to a string data name or variable.

SYNTAX

SET date/time TO string-value
SET string-data-name/variable TO date/time
date/time:
SYSTEM-DATE | SYSTEM-TIME | TERMINAL-DATE
string-value
data name, variable, constant, or expression that results in a string.
string-data-name/variable
a string data name or variable name.

NOTES

  • For SYSTEM-DATE and TERMINAL-DATE, the format of the string-value must agree with the system date format established in the Installation Record. For example, the string “YY/MM/DD” represents the year, month, day format. A slash is used to separate the elements. The elements in the string-value must be separated by a slash, space or other character.
  • For SYSTEM-TIME, the format of the string-value must be “HH:MM:SS”, where HH, MM, and SS represent hours, minutes, and seconds, each separated by a colon. The elements must be separated by a colon, space or other character.
  • SYSTEM-DATE is maintained by the operating system and updated automatically, while TERMINAL-DATE, which is independently set by each task, is not.
  • SYSTEM-TIME returns the system time in the format HH:MM:SS. SYSTEM-TIME is based on a 24-hour system, where 00:00:00 represents midnight, 12:00:00 represents noon, and 13:00:00 represents 1:00 P.M.

EXAMPLES

SET TERMINAL-DATE TO "12/31/95"
SET CUR-TIME TO SYSTEM-DATE

SEE ALSO

SYSTEM-TIME, SYSTEM-DATE, TERMINAL-DATE in Script-IV Language, and DAY and TIM variables in the Thoroughbred Basic Language Reference

From the Script-IV Language Reference, version 8.9.1. Open this page in the PDF