Gets current time.
gettime <strvar> [<format>]
Returns the current time in the string variable <strvar>, with the default format "HH:MM:SS". The user can specify the format same as strftime. And also, the default format equals "%H:%M:%S" at the <format> argument.
The behavior of the gettime command specified with the format equals the getdate 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. |
;Stores the current time to "timestr" variable with HH:MM:SS format. gettime timestr ;Stores the current date with the user format to "logfile" variable. ;The format is log-YYYYMMDD-HHMMSS.txt. gettime logfile "log-%Y%m%d-%H%M%S.txt" changedir 'C:\Test' logopen logfile 0 0 logwrite 'test data' logclose