Garry's Mod Wiki

file.Time

  number file.Time( string path, string gamePath )

Description

Returns when the file or folder was last modified in Unix time.

Arguments

1 string path
The file or folder path.
2 string gamePath
The path to look for the files and directories in. See this list for a list of valid paths.

Returns

1 number
Seconds passed since Unix epoch, or 0 if the file is not found.

Example

Prints out the last modified date of file helloworld.txt

print( os.date("%d.%m.%Y", file.Time("helloworld.txt", "DATA") ) )
Output: 04.08.2012

Example

Prints out the last modified date of folder lua

print( os.date( "%d.%m.%Y", file.Time( "lua", "GAME" ) ) )
Output: 31.01.2016