Commands/time

Changes or queries the world's game time.
==Syntax==
* Java Edition
: time add <time>
:: Adds <time> to the in-game daytime.
: time query (daytime|gametime|day)
:: Queries current time.
: time set (day|night|noon|midnight)
: time set <time>
:: Sets the internal daytime.
* Bedrock Edition
: time add <amount: int>
:: Adds <time> to the internal daytime.
: time query <daytime|gametime|day>
:: Queries current time.
: time set <amount: int>
: time set 
:: Sets the internal daytime.
==Arguments==
: Specifies the time to add or set.
: 
: Specifies the time to query. Must be daytime, gametime or day.
:* daytime - the number of game ticks since dawn. (the internal daytime modulo 24000)
:* gametime - the age of the world in game ticks. (the game time modulo 2147483647)
:* day - the number of in-game days passed. (the internal daytime divided by 24000, then modulo 2147483647)
: 
: 
: Specifies the time to set.
: Must be day, night, noon, midnight, sunrise, or sunset.
:* day = 1,000
:* night = 13,000
:* noon = 6,000
:* midnight = 18,000
:* sunrise = 23,000
:* sunset = 12,000
== Notes ==
/time set ... command always directly sets the "internal daytime" to the specified number. But , when is specified, it increases the "internal daytime" to meet the specified .
For example:
:, when executing /time set day or /time set 1000, the "internal daytime" is set to 1000, so the "day" value returns to 0.
:, when executing /time set 1000, the "internal daytime" is also set to 1000. But if now the "internal daytime" is 25001 (1 day + 1001 ticks), after executing /time set day, it won't become 1000 or 25000, since it only increases time when using . In fact, it turns into 49000 (2 days + 1000 ticks), and the "day" value becomes 2. If now the "internal daytime" is 25000 (1 day + 1000 ticks), after executing /time set day, it remains unchanged.
==Result==
== Output ==
==Examples==
* To set the time to 1,000: time set 1000
* To add one day to the world time: time add 24000
* To change/reset in-game day count to desired number: time set <desired day number*24000+time of day in ticks>; to change day count to day 472 at noon (6000): time set 11334000
== History ==
 
 
de:Befehl/time
es:Comandos/time
ja:コマンド/time
pt:Comandos/time
zh:命令/time