systemTimeUTC: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
BrettMayson (talk | contribs) mNo edit summary |
||
(23 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| arma3 | | |game1= arma3 | ||
|version1= 2.00 | |||
| | |gr1= Time | ||
| | |descr= Returns [[systemTime]] according to '''U'''niversal '''T'''ime '''C'''oordinated time scale. | ||
| | |s1= [[systemTimeUTC]] | ||
| [[ | |r1= [[Array]] of [[Number]]s in format [year, month, day, hour, minute, second, millisecond] | ||
| | |x1= <sqf>private _UKTime = systemTimeUTC;</sqf> | ||
| | |x2= <sqf>systemTimeUTC apply { if (_x < 10) then { "0" + str _x } else { str _x } }; // ["2021","05","03","14","09","37","593"]</sqf> | ||
| [[systemTime]] | |x3= <sqf> | ||
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 | |||
</sqf> | |||
|seealso= [[systemTime]] [[date]] [[time]] [[dayTime]] [[diag_tickTime]] [[serverTime]] [[missionStart]] [[diag_deltaTime]] | |||
}} | }} | ||
Latest revision as of 06:40, 7 November 2023
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:
- Example 2:
- 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
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