Friday, May 3, 2024
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 30453  / 2 Years ago, thu, december 2, 2021, 4:21:22

I am trying to display only the current time using "date", not all that information Day, Month, Year etc.. , only the current time.



i.e.:



13:45 or 1:45pm



Any ideas?


More From » command-line

 Answers
7
date +%R


will show you the 24 hour time, and



date +%r


will show you the time in 12 hour format. date +%H:%I also works.



Check out the "Conversion Specifications" in the manpage for more variables to pick and choose.


[#29837] Friday, December 3, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
quivedge

Total Points: 223
Total Questions: 116
Total Answers: 124

Location: Slovenia
Member since Wed, Apr 6, 2022
2 Years ago
;