FileTime (File Timestamp)

The FileTime function returns the last modified timestamp of a file.

Syntax

Variable = FileTime ( FileHandle )

Remarks

The FileHandle parameter specifies the file for which a timestamp should be returned. The value returned is the last modified timestamp, in seconds since January 1, 1990, with a resolution of 2 seconds. . If FileHandle is a string expression, then it references the location and name of the file. E.g., "Device:FileName" where Device is CPU, CRD (memory card), USR (user-defined drive), or USB (SC115) Else, FileHandle references the return from the FileOpen function.

If Variable is declared as Long, it can be sampled into a data table using the NSEC data format to return a formatted timestamp (mm/dd/7777 hh:mm:ss). If the function fails it will return -2,147,483,648, which, if sampled using NSEC results in a date of 12/13/1921 20:45:52. The function may fail because the file is opened for writing or the file cannot be found. If FileHandle is formatted as a string, make sure the string is sized large enough to accommodate the entire file name.

Parameter

FileHandle (File Handle)

The program reference to the file being read from, written to, or otherwise affected by the function. A FileHandle is created by a FileOpen function and deleted by FileClose. Recommended variable type is Long.

Type: Variable