BIS fnc timeToString: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Formatted page)
Line 1: Line 1:


{{Function|= Comments
____________________________________________________________________________________________


| arma2 |= Game name
{{Function|=
 
|1.00|= Game version
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Arma 3 |= Game


//------------------
|0.50|= Game Version (number surrounded by NO SPACES)
// Authors: Peter Morrison (snYpir) & Philipp Pilhofer (raedor)
// Purpose: This function returns a 24-hour time as a string from a decimal
// Arguments: [daytime]
// Return: boolean


/*
|arg= "local" |= Multiplayer Arguments
This is meant to be used with the 'daytime' command, for
example if 'daytime' was 7.36, '[daytime] call TimeToString'
would return 07:21:36


No rounding of the time is done - ie time is returned as per
|eff= "local" |= Multiplayer Effects
a clock
____________________________________________________________________________________________


The second array element passed in is the return time format.
| This function returns a 24-hour time as a string from a decimal |= Description
It can be:
 
"HH"          - Hour
"HH:MM"      - Hour:Minute
"HH:MM:SS"    - Hour:Minute:Seconds
"HH:MM:SS:MM" - Hour:Minute:Seconds:Milliseconds
"ARRAY"      - [Hour,Minute,Seconds,Milliseconds]
 
If the second parameter is not passed in, it defaults to
"HH:MM:SS"
*/
 
//
// Revision History:
// 09/01/08 0.1 - First cut VBS2
//------------------
 
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_timeToString]]; --> |= Syntax
| [] [[call]] [[BIS_fnc_timeToString]]; |= Syntax


|p1= |= Parameter 1
|p1= [[Number]] - time to convert |= Parameter 1


| |= Return value
|p2= [[String]] - format (optional): <br>
<br><br>
"HH"                    - Hour <br>
"HH:MM"              - Hour:Minute <br>
"HH:MM:SS"      - Hour:Minute:Seconds (default) <br>
"HH:MM:SS:MM" - Hour:Minute:Seconds:Milliseconds <br>
"ARRAY"          - [Hour,Minute,Seconds,Milliseconds] <br>
|= Parameter 2
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1=<code>_time = 7.36;
[_time] call BIS_fnc_timeToString; // 07:21:36</code> |= Example 1
____________________________________________________________________________________________
____________________________________________________________________________________________
|[[Number]]|= Return Value


| |= See also
| SEEALSO |= See Also


}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- BEGIN Note Section -->
 
<!-- For example:
<!-- Note Section END -->
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<dt class="note">'''[[User:User Name|]]'''</dt>
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
-->
<!-- END Note Section -->
</dl>
</dl>


<h3 style="display:none">Bottom Section</h3>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Strings|{{uc:timeToString}}]]
<!-- Appropriate categories go here e.g. [[Category:Arma 3: Functions|{{uc:{{PAGENAME}}}}]] -->
[[Category:Functions|{{uc:timeToString}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:timeToString}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:timeToString}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:timeToString}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:timeToString}}]]

Revision as of 17:03, 8 May 2016


-wrong parameter (""local"argument") defined!--wrong parameter (""local"effect") defined!-
Hover & click on the images for description

Description

Description:
This function returns a 24-hour time as a string from a decimal
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[] call BIS_fnc_timeToString;
Parameters:
Number - time to convert
String - format (optional):


"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:
Number

Examples

Example 1:
_time = 7.36; [_time] call BIS_fnc_timeToString; // 07:21:36

Additional Information

See also:
SEEALSO

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

Bottom Section