daytime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Fix examples and clean comments)
m (Text replacement - "^#redirect \[\[" to "#REDIRECT [[")
 
(24 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
#REDIRECT [[dayTime]]
____________________________________________________________________________________________
 
| ofp |Game name=
 
|1.00|Game version=
____________________________________________________________________________________________
 
| Returns the current in-game time in hours. For a formatted version of time, see [[BIS_fnc_timeToString]].  |DESCRIPTION=
____________________________________________________________________________________________
 
| [[daytime]] |SYNTAX=
 
| [[Number]] - day time using a 24 hour clock, using fractions of hours. |RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>[[daytime]]; {{cc|returns 16.5 given it is 16:30 (4.30pm) in game}}</code> |EXAMPLE1=
 
|x2= Get hour, minute, seconds:
<code>[[private]] _daytime = [[daytime]]; {{cc|assuming [[daytime]] returns 1.66046}}
[[private]] _hours = [[floor]] _daytime; {{cc| 1}}
[[private]] _minutes = [[floor]] ((_daytime - _hours) * 60); {{cc|39}}
[[private]] _seconds = [[floor]] ((((_daytime - _hours) * 60) - _minutes) * 60); {{cc|37}}</code> |EXAMPLE2=
____________________________________________________________________________________________
 
|mp= Returns the current <u>local</u> ingame time in hours. |Multiplayer Note=
 
| [[date]], [[dateToNumber]], [[BIS_fnc_timeToString]], [[time]], [[skipTime]] |SEEALSO=
}}
 
<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:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.46|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Arma_3|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Mission_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Environment|{{uc:{{PAGENAME}}}}]]

Latest revision as of 23:03, 24 June 2022

Redirect to: