Linode Forum Index Linode Forum
Linode Community Forums
 


12hr date

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
galath



Joined: 08 Feb 2012
Posts: 1

Posted: Wed Feb 08, 2012 11:45 pm    Post subject: 12hr date  

I'm wanting to make the 'date' command be 12hr instead of 24hr - is there a way I could do it? I think %I is the correct 12hr instead of %H - but I don't know where to set it.

Thanks
Back to top  
retrograde inversion



Joined: 08 Jun 2011
Posts: 25

Posted: Wed Feb 08, 2012 11:51 pm    Post subject:  

This is described in man date:
Code: SYNOPSIS
       date [OPTION]... [+FORMAT]

So you would type date, then a + followed by an appropriate format string. As an example:
Code: % date +%I
08
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1