string.NiceTime

From Garry's Mod
Jump to: navigation, search
 string.NiceTime( )

Contents

Description

Formats the supplied number (in seconds) to the highest possible time unit.

Arguments

number num

The number to format, in seconds.

Returns

string

A nicely formatted time string.

Examples

Example

print(string.NiceTime(600))
print(string.NiceTime(630))
print(string.NiceTime(660))
print(string.NiceTime(4356))
print(string.NiceTime(43545456))

Output:

10 minutes  
10 minutes  
11 minutes  
1 hour
1 year
Personal tools
Navigation