until¶
Syntax¶
until(year, month, day-of-month, hour)
until(month, day, hour)
until(month, day)
until(day-of-week, hour)
until(hour)
until(timestamp)
until(datestamp)
Parameters¶
year- Expression that evaluates to a number between 1900 and 2200.
month- Expression that evaluates to a number between 1 and 12 or a three-letter abbreviation for a month,
Jan,Feb, ...,Dec. day-of-month- Expression that evaluates to a number between 1 and 31.
day-of-week- A three-letter abbreviation for a day of the week, that is,
Sun,Mon,Tue,Wed,Thu,Fri, orSat. hour- Expression that evaluates to a number between 0 and 23 or a number followed by
amorpm, for example,2pm(no spaces) timestamp- Expression that evaluates to a number with format YYYYMMDDHH.
datestamp- Expression that evaluates to a number with format YYYYMMDD.
Returns¶
Returns the number of hours until the specified date and time.
Description¶
The action determines the type of the arguments based on the number of arguments. In the case of two arguments, at least one of the arguments must be an abbreviation for a month, a day of the week, or an hour.
Returns the number of hours until the specified date and time.
If the expression does not evaluate to a valid time and date, a run-time error will occur and the simulation will terminate.
Examples¶
wait(until(2020,12,31,23))
wait(until(2020, Dec, 31, 11pm))
wait(until(year+1, Jan, 1, 12am)) # wait until next New Year's day
wait(until(Dec, 12, 3pm))
wait(until(Sat, 11pm))
wait(until(Dec, 31)) # wait until 12am on Dec. 31
wait(until(2pm)) # wait until 2pm in the afternoon
my_timestamp = 1000000*year + 10000*month + 100*day_of_month + hour
wait(until(my_timestamp))
my_datestamp = 10000*year + 100*month + day_of_month
wait(until(my_datestamp))