Files
DevOps/Linux/show time and date.md
2025-10-11 22:59:44 +02:00

29 lines
723 B
Markdown

# Show time and date
Use the `date` command to se time and date.
The command can take parameters to select what information to display.
To see only date, use `date ""`
Here,
%H: Used to print hours in 24hr format
%M: Shows minutes
%S: Prints seconds
%d/%m/%y: Shows date, time, and year respectively.
And if you want a 12hrs clock, you can use the following:
## Ubuntu 24.04: Change timezone
### Changing Timezone via CLI (command line interface)
- Find your Timezone: `timedatectl`
- List timezones: `timedatectl list-timezones`
- Find timezone you with to set: `timedatectl list-timezones | grep Oslo`
- Set New Timezone: `sudo timedatectl set-timezone Europe/Oslo`
### Verify timezone settings
`$ timedatectl`