daytime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *[Mm]ultiplayer *[Nn]ote *= * " to " ")
m (Text replacement - "^#redirect \[\[" to "#REDIRECT [[")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=command
#REDIRECT [[dayTime]]
 
| ofp
 
|1.00
 
|gr1= Environment
|gr2= Mission Information
|gr3= Time
 
| Returns the current in-game time in hours. For a formatted version of time, see [[BIS_fnc_timeToString]].
 
| [[daytime]]
 
| [[Number]] - day time using a 24 hour clock, using fractions of hours.
 
|x1= <code>[[daytime]]; {{cc|returns 16.5 given it is 16:30 (4.30pm) in game}}</code>
 
|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>
 
|mp= Returns the current <u>local</u> ingame time in hours.
 
| [[date]], [[dateToNumber]], [[BIS_fnc_timeToString]], [[time]], [[skipTime]], [[systemTime]], [[systemTimeUTC]]
}}
 
 
[[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}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}

Latest revision as of 23:03, 24 June 2022

Redirect to: