IFDATE Conditional branch upon date comparison |
Top Previous Next |
Form 1
Form 2
Form 3
Form1 of this command is used to compare two specified date strings in the format of mm.dd.yy.
Form 2 of this command is used in conjunction with the FILECOMPARETO and FILECOMPAREFROM script commands to test the results of a date/time stamp comparison of a local file and a file on the FTP site.
Form 3 of this command is used in conjunction with the most recently executed GETNEXTFILE, GETFILE, GETSITEFILE, or FTPGETFILE command to compare the date of the file with a specified date string.
When specifying a date, leading zeroes are required. The following are examples of valid date strings.
Syntactically, no space is permitted to the left of the ‘!’, '=', '<' or '>' symbols, and a space is required to the right of these symbols.
Example of Form 1
The following conditional branch is taken if the current date is past June 30, 2003.
IFDATE> %date "06-30-03" GOTO later_date
Example of Form 2
Possible result codes stored in %comparedate for the FILECOMPARETO command are listed below.
Possible result codes stored in %comparedate for the FILECOMPAREFROM command are listed below.
In the following example, the conditional branch is taken if a local file is older than the corresponding file on the FTP site.
FILECOMPAREFROM "c:\Program Files\Robo-FTP X.X\thisfile" IFDATE $ERROR_LOCAL_FILE_OLDER GOTO found it
Example of Form 3
The following conditional branch is taken if a local file just obtained with the GETNEXTFILE command has a date stamp after June 30, 2003.
GETNEXTFILE "*.txt" IFDATE> "06-30-03" GOTO good_file
Related command(s): IFDATETIME, IFTIME, FILECOMPARETO, FILECOMPAREFROM, GETNEXTFILE, GETFILE, GETSITEFILE, FTPGETFILE, DATEADD, DATESUB See also: Comparing Local and Remote Files, Comparing File Dates and Times, Using the %date, %datetime, and %time Variables |