Skip to content

Commit

Permalink
add command date
Browse files Browse the repository at this point in the history
  • Loading branch information
jian-hong-wu committed Aug 16, 2021
1 parent 53835ca commit 9393ca8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions shell/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,24 @@ $ top

$ file

$ date

//取今天時間
$ date -d “now” %Y-%m-%d

//取昨天時間
$ date -d “yesterday” %Y-%m-%d
$ date -d “1 days ago” %Y-%m-%d
## -d, –date=STRING display time described by STRING, not `now’
STRING可以為‘now’ 、 ‘yesterday’、 ‘n days ago’
‘n days ago’ 表示n天前的那一天

//取前天時間
$ date -d “2 days ago” %Y-%m-%d

//取下週一時間
date -d 'next Mon' +%Y-%m-%d

//取上週一時間
date -d 'last Mon' +%Y-%m-%d

0 comments on commit 9393ca8

Please sign in to comment.