![]() |
TrFile_GetDateModified |
Returns the modification date for the file specified by the filePath. The modification date is also displayed in the Finder or Explorer.
Syntax
TrFile_GetDateModified ( switches ; filePath )
Parameters
switches | modifies the action of the function |
filePath | the path to the file for which you want the information |
Switches
Switches can be empty or one of this:
-UTC | returns the modification date in UTC (Coordinated Universal Time) |
Returned Result
Data type returned
Date
Result
The returned result is the modification date of the file. The date is in the same format as a date field.
An error code might also be returned. An error always starts with 2 dollars, followed by the error code. Returned error codes can be:
$$-43 | fnfErr | File not found, check if the path is valid |
$$-1 | genericErr | The file could not be found (older versions of the plug-in) |
Other errors may be returned.
Originated in
Troi File Plug-in 1.0
Compatibility
FileMaker Pro 18 to FileMaker Pro 22 (2025)
Considerations
You can use FileMaker styled paths, like “filewin:/C:/MyFiles/test.txt”.
The returned date is in the local time zone. Use -UTC to get the date in the UTC timezone (Coordinated Universal Time or GMT).
v16.0.1 added the switch -UTC
Example
Set Field [ modificationDate ; TrFile_GetDateModified ( "-Unused" ; "C:\Test.txt" ) ]
This may return the number 730173 which is equivalent to the date: 23 Feb. 2000.
Example 2
We assume that in your FileMaker file the following fields are defined:
modificationDate date
gFilePath Global, text
gFilePath should contain the path to the file, for example “D:\Logs\L2000_01.TXT” (Windows) or “Mac HD:Logs:Log 2000_01” (Mac). In a script add the following script step:
Set Field [ modificationDate ; TrFile_GetDateModified ( "-Unused" ; gFilePath ) ]
This will store the modification date of the file specified by gFilePath in the field modificationDate.
Used in example file
DataIn.fmp12
Related functions
TrFile_GetDateCreated |
TrFile_GetTimestampModified |
TrFile_SelectFileDialog |
Related topics
Troi File Plug-in online help (overview)