Syntax:

GETFILETIME(location,file)

  • location: Set it to one of the following values.
    LOCAL The file in the second parameter is a local file.
    REMOTE The file in the second parameter is a file located in the FTP server.
  • file: file name with or without path.

Remarks:

This command will also return the last modification time of a given directory. Just make sure that the “file” parameter ends with a “/”

The last mofication time of the remote files is the time reported by the FTP server without any modification. No adjustment is done based on the clock time difference with the FTP server.

Return Value:

GETFILETIME returns the modification time of the file using this format YYYY_MM_DD-hh_mm_ss. In the case of error it returns a negative value containing the error code.

Command compatibility:

This command was added in ScriptFTP 3.2 build Jan 11th 2009.

See also:

GETFILESIZE

Example:

# Get the file modification time of the remote file
# test1.txt located in the current remote directory
$time=GETFILETIME(REMOTE,"test1.txt")
 
# The modifcation time is
PRINT($time)
 
# Get the file modification time of the remote file
# test2.txt located in myremotedir/myremotesubdir/
$time=GETFILETIME(REMOTE,"myremotedir/myremotesubdir/test2.txt")
 
# The modifcation time is
PRINT($time)
 
# Get the file modification time of the remote file
# test3.txt located in the remote root directory
$time=GETFILETIME(REMOTE,"/test3.txt")
 
# The modifcation time is
PRINT($time)
 
# Get the file modification time of the local file
# test4.txt located in the current local directory
$time=GETFILETIME(LOCAL,"test4.txt")
 
# The modifcation time is
PRINT($time)
 
# Get tthe file modification time of the local file
# test5.txt located in D:\example
$time=GETFILETIME(LOCAL,"D:\example\test5.txt")
 
# The modifcation time is
PRINT($time)