Command to Output Current Time in Ubuntu Terminal

In Ubuntu system, you can use the following command to output the current time:

date

This command will display the complete current date and time, including the day of the week, month, date, specific time, and time zone information.

If you only need the time part, you can use the format parameter:

date +"%H:%M:%S"

This will output a 24-hour format time like 14:35:22.

Other commonly used time formatting methods:

  • date +"%I:%M:%S %p" - 12-hour format time with AM/PM indicator
  • date +"%T" - Equivalent to %H:%M:%S
  • date +"%X" - Displays the time representation format of the current locale
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye