I don't usually start forum threads but this time I would like to let the users know that the next version of ScriptFTP (3.4) will include a more complete support for operations with date/time values. I think that this is a long awaited feature (apart from SFTP ) and any comments or thoughts are welcome.
This feature is only available in the development build of ScriptFTP which can be downloaded from here:
http://www.ScriptFTP.com/ScriptFTP_devel_setup.exe
Date and Time operations with ScriptFTP (draft)
Apart from doing operations with numbers and text strings, ScriptFTP can also handle date and time values. This kind of operations are specially useful, for example, to check if a certain file is newer than other, or to download only the files that were created a month ago.
The ScriptFTP date/time values have the following format: YYYY_MM_DD-HH_MM_SS. This means that every date/time value must follow this format. If the value does not match this specific criteria ScriptFTP will think that it is a text string or a number and will produce wrong results.
The following example shows how to set a value that contains a specific date/time and then we compare this value against a file modification time:
Allowed Date/time operations
This feature is only available in the development build of ScriptFTP which can be downloaded from here:
http://www.ScriptFTP.com/ScriptFTP_devel_setup.exe
Date and Time operations with ScriptFTP (draft)
Apart from doing operations with numbers and text strings, ScriptFTP can also handle date and time values. This kind of operations are specially useful, for example, to check if a certain file is newer than other, or to download only the files that were created a month ago.
The ScriptFTP date/time values have the following format: YYYY_MM_DD-HH_MM_SS. This means that every date/time value must follow this format. If the value does not match this specific criteria ScriptFTP will think that it is a text string or a number and will produce wrong results.
The following example shows how to set a value that contains a specific date/time and then we compare this value against a file modification time:
Code: Select all
<add some text here>$date1="2009-11-01_14_39_54"
$file_date=GETFILETIME(REMOTE,"test.txt")
IF($file_date>$date1)
PRINT("The remote file has been modified after Nov. 1th 2009 at 14:39:55
ELSE
PRINT("The remote file has NOT been modified after Nov. 1th 2009 at 14:39:55
END IF
Allowed Date/time operations
- Substract dates
- Compare dates
- Add dates
liked Script FTP? Try our other product Email Parser