Page tree
Skip to end of metadata
Go to start of metadata




Introduced in

Version:3.6

Description

Description:Formats the given number of seconds to the wanted countdown-like format. For example, 96 becomes 01:36 (depending on the chosen format).
See fn vbs dateToString for the possible format options.

Syntax

Syntax:[seconds, wantedFormat] call fn_vbs_formatSeconds
Parameters:
Return Value:String - Formatted time.

Warning

When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.

Examples

Examples:
Display passed time as mm:ss:

_start = time; // remember start time                         
for "_i" from 1 to 3 do {sleep 1}; // action to measure
_duration = [time - _start,"i:s"] call fn_vbs_formatSeconds; // format the seconds
systemChat format ["Done in %1 mm:ss.",_duration];

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes