Skip to main content

TrFile_GetTimestampCreated (function reference)

By June 1, 2025July 8th, 2025Online Help, Troi File Plug-in
Troi File Plug-in > Functions reference > TrFile_GetTimestampCreated
Troi File Plug-in for FileMaker Pro

TrFile_GetTimestampCreated

Returns the creation date and time for the file specified by the filePath.

SyntaxFunction badge

TrFile_GetTimestampCreated ( 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 creation date/time of the file in UTC (Coordinated Universal Time)

Returned Result

Data type returned

Timestamp

Result

The returned result is the creation date and time of the file. The result is formatted like this:
YYYY-MM-DD HH:MM:SS. Store the result in a text 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 [ result ; TrFile_GetTimestampCreated ( "-Unused" ; "C:\Test.txt" ) ]

This may return the result: “2000-02-22 15:55:17”.

Example 2

We assume that in your FileMaker file the following fields are defined:

  creationDateTime	text
  gFilePath		Global, text

gFilePath should contain the path to the file, for example “D:\Logs\L01.TXT” (Windows) or
“Mac HD:Logs:Log File 1” (Mac). In a script add the following script step:

Set Field [ creationDateTime ; TrFile_GetTimestampCreated ( "-Unused" ;  gFilePath ) ]

This will store the creation date and time of the file specified by gFilePath in the field creationDateTime.

Used in example file

Attribute.fmp12

Related functionsFunction badge

TrFile_GetTimeCreated
TrFile_GetTimestampModified
TrFile_SelectFileDialog
TrFile_SetTimestampCreated

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 18 to 2025 –> TrFile_GetTimestampCreated (filep4232) 2025-0708 21:38:29

troi.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping us to understand which sections of the website you find most interesting and useful.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.