Java 26.2
Time Command
Time
@p
/time set day
Set, add, query
Time in Minecraft is measured in ticks — 24,000 per in-game day — and /time set 6000 is noon, not six in the morning. Choose set, add or query here, use named values where they exist, and query daytime, gametime or the day counter without confusing the three.
Time is measured in ticks, 24000 per day, and /time set 6000 is noon -- not six in the morning. /time set day is 1000 and /time set night is 13000. The named values save you the arithmetic.
/time query daytime returns the time within the current day, gametime returns total ticks since the world was created, and day returns the day counter. They answer different questions, so pick the one your logic needs.
Set the time you want, then /gamerule doDaylightCycle false so it stops advancing. Without that gamerule the cycle overrides your /time set immediately.
Java 26.2
@p
/time set day