getdate

Gets current date.

getdate <strvar> [<format>]

Remarks

Returns the current date in the string variable <strvar>, with the default format "YYYY-MM-DD". The user can specify the format same as strftime. And also, the default format equals "%Y-%m-%d" at the <format> argument.

The behavior of the getdate command specified with the format equals the gettime command specified with the same format.

This command returns one of the following values in the system variable "result":

Value Meaning
0 Normal success. <strvar> is stored.
1 Error. <strvar> is not stored because a length of the generated string exceeds the upper limit -255 characters-.
2 Error. <format> is invalid.

Example

;Stores the current date to "datestr" variable with YYYY-MM-DD format.
getdate datestr

;Stores the current date with the user format to "logfile" variable. 
;The format is log-YYYYMMDD-HHMMSS.txt.
getdate logfile "log-%Y%m%d-%H%M%S.txt"

See also