×
Menu
Index

GETDATETIME Subroutine

 
Usage:
s = GETDATETIME([datetimevalue])
 
Description:
The GETDATETIME subroutine returns a date and time string value based on the current locale setting. If datetimevalue is not provided then the current date and time are used. The datetimevalue parameter is a numeric value based on either Unix time or Windows file time. Large values are assumed to be Windows file time, smaller values Unix time.
 
NOTE: The Right(TBSVER,3)="x16" version of TBScript does not support the datetimevalue parameter and will return an empty string.
 
Example:
sub main()
   // Extract components of current date/time
   datetime = getdatetime()
   month = mid(time, 1, 2)
   day = mid(time, 4, 2)
   year = mid(time, 7, 4)
   hour = mid(time, 12, 2)
   min = mid(time, 15, 2)
   sec = mid(time, 18, 2)
end sub