Using the %date, %datetime, and %time Variables

Top  Previous  Next

 

These variables contain the current system date and time.

 

The %date variable contains the current system date in the form mm-dd-yy (i.e., 02-16-01). Note: the more common mm/dd/yy (i.e. 02/16/01) form is not used so that the %date variable may be used to name files.

 

The %datetime variable contains a formatted date and time string (i.e., Sat Feb 17 11.00.22 2001). Alternate variable %timedate is also accepted.

 

The %time variable contains the current system time in the form hh.mm.ss (i.e., 11.00.22). Note: the more common hh:mm:ss (i.e. 11:00:22) form is not used so that the %time variable may be used to name files.

 

Consider the following example where a file name is created using the current time in order to make it unique. The resulting file name would be something like: c:\data\file.11.00.22.

 

SET $rcvfile = "C:\data\file."

SET $rcvfile &= %time

 

Consider the following example where a unique directory is created beneath the FileLink current working folder.

 

MAKEDIR %datetime