file.Time

From Garry's Mod
Jump to: navigation, search
 file.Time( )

Contents

Description

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

Arguments

string path

The file or folder path.

Arguments

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

number

Seconds passed since Unix epoch.

Examples

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

Examples

Example

Prints out the last modified date of folder lua

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

Output:

31.01.2016
Personal tools
Navigation