How to change the time in Minecraft

As with a regular day on planet earth, over time your Minecraft server will cycle from day to night and back again. Unlike earth however, 1 day in Minecraft is 20 minutes and not 24 hours. With mobs spawning mostly during the night, it's sometimes helpful to be able to query and change the time. Here are some ways you can query and manipulate the time on your server using commands.

The following commands will query the current time on your server:

/time query daytime - The current time of day, shown in game ticks (0-24000)

/time query gametime - The age of the game server in total. Again shown in game ticks.

/time query day - The number of days that has elapsed. ie. the gametime divided by 24000.

An example below is shown from the Minehost console. You can access the console for your server under the "Console" link in the Server main menu - (The console will only be available when the server is up and running). Alternatively, if you are a server operator, you can enter these as chat commands on the game itself.

Example of the Minecraft /time query command.

As previously discussed, time of day is represented as the number of game ticks from 0-24000. Again using the time command we can set the time of day using the command below:

/time set <time> - Where time is between 0-24000, representing the time of day.

However <time> can also be one of the following preset values.

  • day = 1,000 - Beginning of the day.
  • noon = 6,000 - Sun at it's peak.
  • night = 13,000 - Beginning of the day.
  • midnight = 18,000 - Moon at it's peak.

Examples of how to set the time are below:

Example of the Minecraft /time set command.

Finally, we can use the /time add <time> command to increment the time on a running server. Again <time> is the number of game ticks you wish to add:

Example of the Minecraft /time add command.

If you would like time to not change as you play the game, for example you'd like the time to be permanently day, you can disable the time moving forward with the game rule doDaylightCycle. Setting this to false will effectively stop time, meaning the sun will not move across the sky for example.

/gamerule doDaylightCycle false

After running this command, if you run /time set day for example, your server will remain permanently in daytime. To enable time again and go back to normal just run /gamerule doDaylightCycle true