BIS fnc secondsToString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(\[[a-zA-Z,. ]*\] call ('''|\[\[)?BI(N|S)_fnc_[a-zA-Z]+('''|\]\])?) * \|p1=" to " |s1=$1 |p1=")
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{RV|type=function
{{RV|type=function


| tkoh
|game1= tkoh
|version1= 1.00


|1.00
|game2= arma3
|version2= 0.50


|gr1= Strings
|gr1= Strings


| Convert seconds to formatted string.
|descr= Convert seconds to formatted string.


|s1=[totalSeconds, format, returnArray] call [[BIS_fnc_secondsToString]]
|s1= [totalSeconds, format, returnArray] call [[BIS_fnc_secondsToString]]


|p1= totalSeconds: [[Number]] - time in seconds (see [[time]])
|p1= totalSeconds: [[Number]] - time in seconds (see [[time]])
Line 26: Line 28:
|p3= returnArray: [[Boolean]] - (Optional, default false)
|p3= returnArray: [[Boolean]] - (Optional, default false)


|r1=[[String]] or [[Array]] of [[String|Strings]] if ''returnArray'' is set to [[true]]
|r1= [[String]] or [[Array]] of [[String]]s if ''returnArray'' is set to [[true]]


|x1= <code>[[hint]] [[format]] ["Hi, it is currently %1.", [<nowiki/>[[time]], "HH:MM"] [[call]] [[BIS_fnc_secondsToString]]];</code>
|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]]
|seealso= [[time]] [[BIS_fnc_showTime]] [[BIS_fnc_timeToString]]
}}
}}
[[Category:{{Name|tkoh}}: Functions|{{uc:secondsToString}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:secondsToString}}]]

Latest revision as of 17: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