serverTime: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(format)
m (Text replacement - "{{Feature|Informative|" to "{{Feature|informative|")
 
(59 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
|version2= 1.50


|arg= global |= MPARGUMENTS
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| Server time synchronized to clients. Returns always 0 in Singleplayer.
|game4= arma3
<br />Note that in ArmA2 1.05 Final, this command only returns the time since the '''Server''' was actually started.
|version4= 0.50


<br><br>NOTE: [[serverTime]] is available to both server and clients and shows the same value when synced. The only time it is not synced is on the server, right after server restart and only for the first 300 seconds. Client side [[serverTime]] is synced from the start. [[serverTime]] is also different from server [[time]] and server [[diag_tickTime]] |= Description
|eff= global
____________________________________________________________________________________________


| '''serverTime''' |= Syntax
|gr1= Time


|p1= |= PARAMETER1
|gr2= Mission Information


|p2= |= PARAMETER2
|gr3= Multiplayer


|p3= |= PARAMETER3
|descr= Returns the time since latest server (re)start in seconds. It is synced to all clients in MP - both at mission start and when a new client connects to it. Beyond that the server is syncing to clients every 5 minutes. You can force the next sync earlier by executing [[estimatedTimeLeft]] command.{{Feature|important|The time returned is different to the time returned by [[time]] and [[diag_tickTime]] commands on server. Returns 0 in SP.}}


| [[Number]] |= RETURNVALUE
{{Feature|informative|'''Known issues before Arma 3 v1.86''':  Both server and clients showed the same value when synced. The only time it was not synced was on the server, right after server restart and only for the first 300 seconds. Client side was synced from the start}}


|s1= '''serverTime'''


|x1= <code>hint format["Connected on Server since Serverstart : %1", serverTime - time]</code>|= EXAMPLE1
|r1= [[Number]]


____________________________________________________________________________________________
|x1= <sqf>hint format ["Synced server time : %1", serverTime];</sqf>


| [[time]], [[diag_tickTime]] |= SEEALSO
|seealso= [[time]] [[diag_tickTime]] [[date]] [[missionStart]] [[estimatedTimeLeft]] [[estimatedEndServerTime]] [[systemTime]] [[systemTimeUTC]]
 
|  |= MPBEHAVIOUR
____________________________________________________________________________________________
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
There is a bug in this command, about 3 minutes after missionstart this command returns something completely different.
See http://dev-heaven.net/issues/13581 for further infomation. --[[User:Crowe|Crowe]] 19:31, 8 September 2010 (CEST)
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:ArmA 2: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 01:24, 2 February 2024

Hover & click on the images for description

Description

Description:
Returns the time since latest server (re)start in seconds. It is synced to all clients in MP - both at mission start and when a new client connects to it. Beyond that the server is syncing to clients every 5 minutes. You can force the next sync earlier by executing estimatedTimeLeft command.
The time returned is different to the time returned by time and diag_tickTime commands on server. Returns 0 in SP.
Known issues before Arma 3 v1.86: Both server and clients showed the same value when synced. The only time it was not synced was on the server, right after server restart and only for the first 300 seconds. Client side was synced from the start
Groups:
TimeMission InformationMultiplayer

Syntax

Syntax:
serverTime
Return Value:
Number

Examples

Example 1:
hint format ["Synced server time : %1", serverTime];

Additional Information

See also:
time diag_tickTime date missionStart estimatedTimeLeft estimatedEndServerTime systemTime systemTimeUTC

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