Skip to content

Instantly share code, notes, and snippets.

@Sy3Omda
Created July 28, 2020 13:58
Show Gist options
  • Save Sy3Omda/8c96691681c8684a95c9cf26e2d64876 to your computer and use it in GitHub Desktop.
Save Sy3Omda/8c96691681c8684a95c9cf26e2d64876 to your computer and use it in GitHub Desktop.
Format options Purpose of Option Output
date +%a Displays Weekday name in short (like Mon, Tue, Wed) Thu
date +%A Displays Weekday name in full short (like Monday, Tuesday) Thursday
date +%b Displays Month name in short (like Jan, Feb, Mar ) Feb
date +%B Displays Month name in full short (like January, February) February
date +%d Displays Day of month (e.g., 01) 07
date +%D Displays Current Date; shown in MM/DD/YY 02/07/13
date +%F Displays Date; shown in YYYY-MM-DD 2013-02-07
date +%H Displays hour in (00..23) format 23
date +%I Displays hour (01..12) format 11
date +%j Displays day of year (001..366) 038
date +%m Displays month (01..12) 02
date +%M Displays minute (00..59) 44
date +%S Displays second (00..60) 17
date +%N Displays nanoseconds (000000000..999999999) 573587606
date +%T Displays time; shown as HH:MM:SS
Note: Hours in 24 Format 23:44:17
date +%u Displays day of week (1..7); 1 is Monday 4
date +%U Displays week number of year, with Sunday as first day of week (00..53) 05
date +%Y Displays full year i.e. YYYY 2013
date +%Z alphabetic time zone abbreviation (e.g., EDT) IS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment