systemTimeUTC: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Undo revision 155172 by R3vo (talk) the commas make no sense, it is coordinated time scale of universal time)
Tag: Undo
mNo edit summary
 
(29 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3dev |Game name=
|game1= arma3
|version1= 2.00


| 1.99 |Game version=
|gr1= Time
____________________________________________________________________________________________


| Returns [[systemTime]] according to '''U'''niversal '''T'''ime '''C'''oordinated time scale. |DESCRIPTION=
|descr= Returns [[systemTime]] according to '''U'''niversal '''T'''ime '''C'''oordinated time scale.
____________________________________________________________________________________________


| [[systemTimeUTC]] |SYNTAX=
|s1= [[systemTimeUTC]]


| [[Array]] in format [year, month, day, hour, minute, second, millisecond] |RETURNVALUE=
|r1= [[Array]] of [[Number]]s in format [year, month, day, hour, minute, second, millisecond]
____________________________________________________________________________________________


|x1= <code>_UKTime = [[systemTimeUTC]];</code> |Example1=
|x1= <sqf>private _UKTime = systemTimeUTC;</sqf>
____________________________________________________________________________________________


| [[systemTime]], [[date]], [[time]], [[daytime]], [[diag_tickTime]], [[serverTime]], [[missionStart]], [[diag_deltaTime]] |SEEALSO=
|x2= <sqf>systemTimeUTC apply { if (_x < 10) then { "0" + str _x } else { str _x } }; // ["2021","05","03","14","09","37","593"]</sqf>
}}


<h3 style="display:none">Notes</h3>
|x3= <sqf>
<dl class="command_description">
private _timeUTC = systemTimeUTC;
<!-- Note Section BEGIN -->
private _time = systemTime;
private _timeDiffH = (_time select 3) - (_timeUTC select 3);
private _timeDiffM = (_time select 4) - (_timeUTC select 4);
if (_timeDiffM < 0) then
{
_timeDiffH = _timeDiffH - 1;
_timeDiffM = _timeDiffM + 60;
};
if (_timeDiffH < -12) then
{
_timeDiffH = _timeDiffH + 24;
};
if (_timeDiffH > 12) then
{
_timeDiffH = _timeDiffH - 24;
};
private _timeZone = [_timeDiffH, _timeDiffM]; // hour (_timeDiffH) is in range -12..+12
</sqf>


<!-- Note Section END -->
|seealso= [[systemTime]] [[date]] [[time]] [[dayTime]] [[diag_tickTime]] [[serverTime]] [[missionStart]] [[diag_deltaTime]]
</dl>
}}
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Time_Functions|{{uc:{{PAGENAME}}}}]]
 
<!-- CONTINUE Notes -->
<!-- DISCONTINUE Notes -->

Latest revision as of 06:40, 7 November 2023

Hover & click on the images for description

Description

Description:
Returns systemTime according to Universal Time Coordinated time scale.
Groups:
Time

Syntax

Syntax:
systemTimeUTC
Return Value:
Array of Numbers in format [year, month, day, hour, minute, second, millisecond]

Examples

Example 1:
private _UKTime = systemTimeUTC;
Example 2:
systemTimeUTC apply { if (_x < 10) then { "0" + str _x } else { str _x } }; // ["2021","05","03","14","09","37","593"]
Example 3:
private _timeUTC = systemTimeUTC; private _time = systemTime; private _timeDiffH = (_time select 3) - (_timeUTC select 3); private _timeDiffM = (_time select 4) - (_timeUTC select 4); if (_timeDiffM < 0) then { _timeDiffH = _timeDiffH - 1; _timeDiffM = _timeDiffM + 60; }; if (_timeDiffH < -12) then { _timeDiffH = _timeDiffH + 24; }; if (_timeDiffH > 12) then { _timeDiffH = _timeDiffH - 24; }; private _timeZone = [_timeDiffH, _timeDiffM]; // hour (_timeDiffH) is in range -12..+12

Additional Information

See also:
systemTime date time dayTime diag_tickTime serverTime missionStart diag_deltaTime

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