Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Unix >> Linux >> Commands >> date >> How to format the output of the date command

 

date +FORMAT   

where FORMAT is a combination of    

%a   locale's abbrev weekday name (Sun, Mon ...)
%A   locale's full weekday name (Sunday, Monday ...)
%u   day of the week (1..7, where 1=Monday)  
%m   2 digit month  
%d   day of the month (01..31)
%e   day of the month, blank padded (1..31)  
%b   locale's abbrev month name (Jan, Feb ...)
%B   locale's full month name (January, February ..)  
%C   locale's century year (divide by 100 and truncate to integer 00-99)
%g   2 digit year
%G   4 digit year   
%I   hour (01..12)      
%H   hour (00..23)  
%M   minute (00..59)  
%s   seconds since epoch  
%S   seconds (0..60)   

etc   

eg. for 01 Jan 2008:-   

date  +%d-%m-%G  

01-01-2008

 

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]