Display the current time in UTC once without changing the system timezone.
Which command is appropriate?
date -u uses UTC for its output without changing the system timezone configuration.
Detailed explanation
date --localIncorrect. --local is not the UTC switch for GNU date.
Incorrect. --local is not the UTC switch for GNU date.
date -uCorrect. -u displays the time in UTC.
Correct. -u displays the time in UTC.
date -s UTCIncorrect. -s changes the system clock.
Incorrect. -s changes the system clock.
hwclock --utcIncorrect. --utc on hwclock concerns RTC interpretation, not date display.
Incorrect. --utc on hwclock concerns RTC interpretation, not date display.
Try it yourself
An example you can run in a temporary verification environment.
date -u '+%Z %z'Expected result
UTC +0000Key points
- -u means UTC
- Display only
- No system change
Notes
- Environment: GNU date / 読取のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.