Garry's Mod Wiki

file.Time

number file.Time( string path, string gamePath )

Description

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

Arguments

1 string path
The file or folder path.
2 string gamePath
The game path to be used.

  • "GAME" Structured like base folder (garrysmod/), searches all the mounted content (main folder, addons, mounted games etc)
  • "LUA" or "lsv" - All Lua folders (lua/) including gamesmodes and addons
  • "DATA" Data folder (garrysmod/data)
  • "MOD" Strictly the game folder (garrysmod/), ignores mounting.

Returns

1 number
Seconds passed since Unix epoch.

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

Page Links


Special Pages


Wikis

?

Render Time: 40ms

DB GetPage 4
Generate Html 7
SaveChanges 16
Render Body 0
Render Sidebar 12