shell Different Date/Time format in shell

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Parameters

FormatInterpreted as
%%literal percent sign (%)
%Aweekday name (e.g. Sunday)
%aweekday name in short fomat (e.g. Sun)
%Bfull month name (e.g. January)
%bmonth name (e.g. Jan)
%Hhour (00..23)
%Ihour (01..12)
%jday of year (001..366)
%khour ( 0..23)
%lhour ( 1..12)
%Mminute (00..59)
%mmonth (01..12)
%pDefine AM or PM; blank if not known
%R24-hour hour and minute; same as %H:%M
%r12-hour clock time (e.g. 11:11:04 PM)
%Ssecond (00..60)
%sUnix epoch: seconds since 1970-01-01 00:00:00 UTC (not available in older UNIXes)
%Ttime, equivalent to %H:%M:%S
%Ztime zone name (e.g. PDT)
%ztime zone offset (direction, hours, minutes, e.g. -0700)

Remarks

Below are a few useful links for the date command in Unix shells:



Got any shell Question?