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



Introduced in

Version:1.19

Description

Description:Converts the content of a daytime variable into a text string. No rounding of the time is done (the time is returned as per the clock.)

Syntax

Syntax:[currtime, format] call fn_vbs_timeToString
Parameters:
  • currtime: Number - Either the system variable daytime, or a user-defined one, in the same format as daytime.
  • format: String - Defines the returned time format (optional).

Valid parameters are (case-sensitive):

  • "HH" - Hour
  • "HH:MM" - Hour:Minute
  • "HH:MM:SS" - Hour:Minute:Seconds (default)
  • "HH:MM:SS:MM" - Hour:Minute:Seconds:Milliseconds
  • "ARRAY" - [Hour, Minute, Seconds, Milliseconds]
Return Value:

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:
_ts=[daytime] call fn_vbs_timeToString; // "12:30:00" if daytime contains 12.5
_ts=[daytime,"HH:MM"] call fn_vbs_timeToString; // "01:06" if daytime contains 1.1

Additional Information

See also: time, daytime, fn vbs dateToString
Multiplayer:
Problems:

Notes

Posted on 6 March, 2009
Kronzky
To use this function with the systemTime, use the following syntax:


[(systemTime select 3)+(systemTime select 4)/60,"HH:MM"] call fn_vbs_timeToString