To display the current time on Ubuntu, you can open the terminal and use the date command.
Simply type the following command in your terminal:
1 | date |
This will show the current date and time in the format of Day Month Date Hour:Minute:Seconds Timezone Year.
If you want to display the time in a specific format, you can use the + sign and a specific format string. For example, the following command will display only the current time in the HH:MM:SS format:
1 |
|
You can also display the time in a 12-hour format with AM/PM by using %r like this:
1 |
|
If you want to display the time continuously updating in the terminal, you can use the watch command. For example, the following command will update the time every 1 second:
1 |
|
This will display the date and time in the HH:MM:SS AM/PM format, updating every 1 second. You can adjust the update frequency as per your requirement by modifying the -n option.