Garry's Mod Wiki


string string.FormattedTime( number float, string format = "nil" )


Returns the time as a formatted string or as a table if no format is given.


1 number float
The time in seconds to format.
2 string format = "nil"
An optional formatting to use. If no format it specified, a table will be returned instead.


1 string
Returns the time as a formatted string only if a format was specified.

Returns a table only if no format was specified. The table will contain these fields:

number ms - milliseconds

number s - seconds

number m - minutes

number h - hours


Formats the time in seconds

local time = string.FormattedTime( 90, "%02i:%02i:%02i" ) print( time )
Output: 01:30:00


Returns a table with the time separated by units.

local time = string.FormattedTime( 90 ) PrintTable( time )
Output: <br>ms = 0<br> m = 1<br> s = 30<br> h = 0<br>

Page Links

Special Pages



Render Time: 99ms

Session 0
DB GetPage 8
Generate Html 13
SaveChanges 58
Render Body 0
Render Sidebar 12