BIS fnc secondsToString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(39 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| tkoh |= Game name
|game2= arma3
|version2= 0.50


|1.00|= Game version
|gr1= Strings
____________________________________________________________________________________________


| <pre>/*
|descr= Convert seconds to formatted string.
Description:
Convert seconds to formatted string.
Parameter(s):
_this select 0: <scalar> time in seconds
_this select 1 (Optional): <string> format
"HH" - Hours
"HH:MM" - Hours:Minutes
"HH:MM:SS" - Hours:Minutes:Seconds (Default)
"HH:MM:SS.MS" - Hours:Minutes:Seconds:Milliseconds
"MM" - Minutes
"MM:SS" - Minutes:Seconds
"MM:SS.MS" - Minutes:Seconds:Milliseconds
"SS.MS" - Seconds:Milliseconds
_this select 2 (Optional): <boolean> return as Array (default: false)
Returns:
String or Array of Strings
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|s1= [totalSeconds, format, returnArray] call [[BIS_fnc_secondsToString]]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_secondsToString]]; --> |= Syntax
|p1= totalSeconds: [[Number]] - time in seconds (see [[time]])


|p1= |= Parameter 1
|p2= format: [[String]] - (Optional, default "HH:MM:SS") can be one of:
* "HH"
* "HH:MM"
* "HH:MM:SS"
* "HH:MM:SS.MS"
* "MM"
* "MM:SS"
* "MM:SS.MS"
* "SS.MS"
''HH = Hours, MM = Minutes, SS = Seconds, MS = Milliseconds''


| |= Return value
|p3= returnArray: [[Boolean]] - (Optional, default false)
____________________________________________________________________________________________


|x1= <code></code> |=
|r1= [[String]] or [[Array]] of [[String]]s if ''returnArray'' is set to [[true]]
____________________________________________________________________________________________


| |= See also
|x1= <sqf>hint format ["Hi, it is currently %1.", [time, "HH:MM"] call BIS_fnc_secondsToString];</sqf>


|seealso= [[time]] [[BIS_fnc_showTime]] [[BIS_fnc_timeToString]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Strings|{{uc:secondsToString}}]]
[[Category:Functions|{{uc:secondsToString}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:secondsToString}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:secondsToString}}]]

Latest revision as of 18:00, 13 July 2022

Hover & click on the images for description

Description

Description:
Convert seconds to formatted string.
Execution:
call
Groups:
Strings

Syntax

Syntax:
[totalSeconds, format, returnArray] call BIS_fnc_secondsToString
Parameters:
totalSeconds: Number - time in seconds (see time)
format: String - (Optional, default "HH:MM:SS") can be one of:
  • "HH"
  • "HH:MM"
  • "HH:MM:SS"
  • "HH:MM:SS.MS"
  • "MM"
  • "MM:SS"
  • "MM:SS.MS"
  • "SS.MS"
HH = Hours, MM = Minutes, SS = Seconds, MS = Milliseconds
returnArray: Boolean - (Optional, default false)
Return Value:
String or Array of Strings if returnArray is set to true

Examples

Example 1:
hint format ["Hi, it is currently %1.", [time, "HH:MM"] call BIS_fnc_secondsToString];

Additional Information

See also:
time BIS_fnc_showTime BIS_fnc_timeToString

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note