fn vbs timeToString (VBS2)
From Bohemia Interactive Community
| Editors, please check Policy: Scripting Command Page Syntax. |
Click on the images for descriptions
Introduced in
- Game:
- Virtual Battlespace 2
- Version:
- 1.19
Description
- Description:
- Converts the content of a daytime variable into a text string.
No rounding of the time is done (i.e. 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 - (optional), defines the returned time format.
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:
Examples
- Example 1:
_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

