setDate: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Undo revision 99596 by Will (talk) see discussion)
m (note cleanup)
Line 13: Line 13:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Sets the actual mission date and time. |= Description
| Sets the actual mission date and time. This command is JIP compatible. Players joining after mission start will get current server [[date]] set up. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 38: Line 38:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">18:52, 6 October 2007 (CEST)
<dt class="note">'''[[User:Doolittle|Doolittle]]'''
<dd class="note">This command is special in that it is "smart". If you add 120 minutes, for example, it will actually advance hours by 2, and so on.


<dd class="notedate">10:00, 7/12/2010 (BST)
<dd class="notedate">10:00, 7/12/2010 (BST)
Line 50: Line 46:
<dt class="note">'''[[User:Osmo|Osmo]]'''
<dt class="note">'''[[User:Osmo|Osmo]]'''
<dd class="note">In multiplayer, the effect of this command is local, not global. The date from the server is synchronized with clients when they join the game (including start of the mission and joining in progress). E.g. if this command is executed on server in the init.sqf before the mission starts, every client will be synchronized with server as mission is started. However, if you run this command in the middle of the mission, effect is local.
<dd class="note">In multiplayer, the effect of this command is local, not global. The date from the server is synchronized with clients when they join the game (including start of the mission and joining in progress). E.g. if this command is executed on server in the init.sqf before the mission starts, every client will be synchronized with server as mission is started. However, if you run this command in the middle of the mission, effect is local.
<dd class="notedate">10 September 2013 (EET)
<dt class="note">'''[[User:Killzone_Kid|Killzone_Kid]]'''
<dd class="note">This command is JIP compatible. Players joining after mission start will get current server [[date]] set up.


<!-- Note Section END -->
<!-- Note Section END -->
Line 85: Line 76:
<dd class="note">
<dd class="note">
Arma 3 1.38.128937- Leapyear BUG - setdate [2016,12,31,23,59] yields an ingame date of the 1st of January 2017. If left to tick over from the 30th of December it ticks to 1st January skipping the 31st of December entirely.
Arma 3 1.38.128937- Leapyear BUG - setdate [2016,12,31,23,59] yields an ingame date of the 1st of January 2017. If left to tick over from the 30th of December it ticks to 1st January skipping the 31st of December entirely.
[http://feedback.arma3.com/view.php?id=22583 Feedback_Link]
</dd>
</dd>
</dl>
</dl>

Revision as of 17:33, 17 June 2018

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

Description

Description:
Sets the actual mission date and time. This command is JIP compatible. Players joining after mission start will get current server date set up.
Groups:
Uncategorised

Syntax

Syntax:
setDate [year, month, day, hour, minute]
Parameters:
[year, month, day, hour, minute]: Array
Return Value:
Nothing

Examples

Example 1:
setDate [1986, 2, 25, 16, 0]; //(4:00pm February 25, 1986)
Example 2:
Set real date: //postInit = 1; if (isServer) then { waitUntil {time > 0}; setDate (missionStart select [0,5]); };

Additional Information

See also:
dateskipTimenumberToDatedateToNumber

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

Notes

10:00, 7/12/2010 (BST)
Alpha
This command sets the date for the southern hemisphere only, i.e. when the map is in northern hemisphere a date [2010,12,7,17,0] is in day light and and date [2010,6,7,17,0] is in darkness.
21:35, 31 October 2011 (EET)
Osmo
In multiplayer, the effect of this command is local, not global. The date from the server is synchronized with clients when they join the game (including start of the mission and joining in progress). E.g. if this command is executed on server in the init.sqf before the mission starts, every client will be synchronized with server as mission is started. However, if you run this command in the middle of the mission, effect is local.

Bottom Section

Posted on October 4, 2014 - 17:43 (UTC)
MulleDK13
Since an unknown version of ARMA 3, this command now has global effect when executed on the server.
Posted on February 5, 2015 - 06:38 (UTC)
Ozdeadmeat
Arma 3 1.38.128937- Leapyear BUG - setdate [2016,12,31,23,59] yields an ingame date of the 1st of January 2017. If left to tick over from the 30th of December it ticks to 1st January skipping the 31st of December entirely.
Posted on April 23, 2017 - 02:58 (UTC)
OOKexOo
Regarding execution in the middle of a session, the post of MulleDK13 is not entirely true. If you don't change the year, you are perfectly fine when executing the command on the server only. However, the server does not sync the year. Hence, if you do change the year, you have to execute the command on the server, clients and JIP to account for the missing sync. e.g.
[[], {setDate [1986, 2, 25, 16, 0]}] remoteExec ["call",0,"JIP_id_setDate"];