Product Site

8.27. SysGetFileDateTime

Returns a file timestamp.

Parameters
filename

The name of a file or directory for which a timestamp should be returned. The name does not support wildcard characters. On Unix-like systems, if the first character is a ~ (tilde) character optionally followed by a username, it is replaced by the current or specified user's home directory.
timesel

An optional selector specifying the type of timestamp to be returned. Depending on the operating system and the file system, one of the following timestamps may be selected (only the first letter is required):
ACCESS

The date and time when the file was last accessed. Not available on FAT file systems.
CREATE

The creation date and time. Not available on Unix-like systems or on FAT file systems.
WRITE

The date and time the file was last modified. This is the default if timesel is omitted.

Returns

The file timestamp in the format yyyy-mm-dd hh:mm:ss, or -1 to indicate that the timestamp is unavailable or could not be retrieved.

See also File methods lastAccessed (Attribute) and lastModified (Attribute), and Rexxutil SysSetFileDateTime.
Example 8.18. RexxUtil — SysGetFileDateTime
say SysGetFileDateTime(".")           -- (e. g.) 2020-04-01 17:45:20
say SysGetFileDateTime("main.c", "w") -- (e. g.) 2020-02-11 05:00:00