Updated:

Common commands

/time set day
/time set night

day sets morning and night sets night, on both Java and Bedrock.

Values for /time set

A Minecraft day is 24000 ticks (20 real minutes). You can use numbers instead of names.

UseTicksTime
day1000Morning, after sunrise
noon6000Sun at its highest
number12000Sunset begins
night13000Night
midnight18000Moon at its highest
number23000Just before dawn

Bedrock also accepts sunrise and sunset.

Advance and check the time

/time add 1000
# Before Java 26.1, and Bedrock
/time query daytime
# Java 26.1 and later
/time query minecraft:day

time add moves the clock forward. time query daytime prints the current time and time query day the number of days, in versions before Java 26.1 and on Bedrock.

Java 26.1 changes

Java 26.1 moved /time to a World Clock system. /time set day and /time add 1000 still work, but checking works differently:

GoalJava 26.1+Older and Bedrock
Current time/time query minecraft:day/time query daytime
Day count/time query minecraft:day repetitions/time query day
Pause and resume/time pause, /time resumeGame rule (below)

From 26.1, /time set day advances to the next morning instead of rewriting the clock, so the day count can go up by one.

Keep it day

VersionCommand
Java 1.21.11 and later/gamerule minecraft:advance_time false
Java 1.21.10 and earlier/gamerule doDaylightCycle false
Bedrock/gamerule dodaylightcycle false

Set the time to day first, then stop the clock. Use true to undo. Bedrock also has /alwaysday true. See the game rule list for other renamed rules.

Common problems

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.