-
Notifications
You must be signed in to change notification settings - Fork 0
/
20Date.sh
executable file
·30 lines (25 loc) · 992 Bytes
/
20Date.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash
<< NotesBlock
Format Description
date +%a Gives name of the weekday [Mon, Sun, Fri]
date +%A Gives name of the weekday [Monday, Sunday, Friday]
date +%b Gives name of the month [Jan, Feb, Mar]
date +%B Gives name of the month [January, February, March]
date +%d Displays day of the month [05]
date +%D Displays current date MM/DD/YY format [11-01-21]
date +%F Shows date in YYYY-MM-DD format [2021-11-01]
date +%H Shows hour in 24-hour format [22]
date +%I Shows hour in 12-hour format [11]
date +%j Displays the day of the year [001 – 366]
date +%m Displays the number of the month [01-12]
date +%M Displays minutes [00-59]
date +%S Displays seconds [00-59]
date +%N Displays in Nanoseconds
date +%T Displays time as HH:MM:SS [in 24-hour format]
date +%u Day of the week [1-7] 1 is Monday, 6 is Saturday
date +%U Shows week number of the year [00-53]
date +%Y Displays year YYYY [2021]
date +%Z Displays Time zone
NotesBlock
today=`date +%D`
echo "Today's date: $today"