[Shell] get after|before year,month,day,week,hour,minute,second
year
[root@oracle ~]# date;date -d "1year"
Tue Mar 8 23:45:18 CST 2016
Wed Mar 8 23:45:18 CST 2017
[root@oracle ~]# date;date -d "-1year"
Tue Mar 8 23:45:25 CST 2016
Sun Mar 8 23:45:25 CST 2015
month
[root@oracle ~]# date;date -d "-1month"
Tue Mar 8 23:46:44 CST 2016
Mon Feb 8 23:46:44 CST 2016
[root@oracle ~]# date;date -d "1month"
Tue Mar 8 23:46:48 CST 2016
Fri Apr 8 23:46:48 CST 2016
day
[root@oracle ~]# date;date -d "1day"
Tue Mar 8 23:47:11 CST 2016
Wed Mar 9 23:47:11 CST 2016
[root@oracle ~]# date;date -d "-1day"
Tue Mar 8 23:47:14 CST 2016
Mon Mar 7 23:47:14 CST 2016
week
[root@oracle ~]# date;date -d "-1week"
Tue Mar 8 23:47:48 CST 2016
Tue Mar 1 23:47:48 CST 2016
[root@oracle ~]# date;date -d "1week"
Tue Mar 8 23:47:52 CST 2016
Tue Mar 15 23:47:52 CST 2016
hour
[root@oracle ~]# date;date -d "1hour"
Tue Mar 8 23:48:06 CST 2016
Wed Mar 9 00:48:06 CST 2016
[root@oracle ~]# date;date -d "-1hour"
Tue Mar 8 23:48:09 CST 2016
Tue Mar 8 22:48:09 CST 2016
minute
[root@oracle ~]# date;date -d "-1min"
Tue Mar 8 23:48:43 CST 2016
Tue Mar 8 23:47:43 CST 2016
[root@oracle ~]# date;date -d "1min"
Tue Mar 8 23:48:46 CST 2016
Tue Mar 8 23:49:46 CST 2016
second
[root@oracle ~]# date;date -d "1second"
Tue Mar 8 23:49:04 CST 2016
Tue Mar 8 23:49:05 CST 2016
[root@oracle ~]# date;date -d "-1second"
Tue Mar 8 23:49:08 CST 2016
Tue Mar 8 23:49:07 CST 2016
[root@oracle ~]# date;date -d "1year"
Tue Mar 8 23:45:18 CST 2016
Wed Mar 8 23:45:18 CST 2017
[root@oracle ~]# date;date -d "-1year"
Tue Mar 8 23:45:25 CST 2016
Sun Mar 8 23:45:25 CST 2015
month
[root@oracle ~]# date;date -d "-1month"
Tue Mar 8 23:46:44 CST 2016
Mon Feb 8 23:46:44 CST 2016
[root@oracle ~]# date;date -d "1month"
Tue Mar 8 23:46:48 CST 2016
Fri Apr 8 23:46:48 CST 2016
day
[root@oracle ~]# date;date -d "1day"
Tue Mar 8 23:47:11 CST 2016
Wed Mar 9 23:47:11 CST 2016
[root@oracle ~]# date;date -d "-1day"
Tue Mar 8 23:47:14 CST 2016
Mon Mar 7 23:47:14 CST 2016
week
[root@oracle ~]# date;date -d "-1week"
Tue Mar 8 23:47:48 CST 2016
Tue Mar 1 23:47:48 CST 2016
[root@oracle ~]# date;date -d "1week"
Tue Mar 8 23:47:52 CST 2016
Tue Mar 15 23:47:52 CST 2016
hour
[root@oracle ~]# date;date -d "1hour"
Tue Mar 8 23:48:06 CST 2016
Wed Mar 9 00:48:06 CST 2016
[root@oracle ~]# date;date -d "-1hour"
Tue Mar 8 23:48:09 CST 2016
Tue Mar 8 22:48:09 CST 2016
minute
[root@oracle ~]# date;date -d "-1min"
Tue Mar 8 23:48:43 CST 2016
Tue Mar 8 23:47:43 CST 2016
[root@oracle ~]# date;date -d "1min"
Tue Mar 8 23:48:46 CST 2016
Tue Mar 8 23:49:46 CST 2016
second
[root@oracle ~]# date;date -d "1second"
Tue Mar 8 23:49:04 CST 2016
Tue Mar 8 23:49:05 CST 2016
[root@oracle ~]# date;date -d "-1second"
Tue Mar 8 23:49:08 CST 2016
Tue Mar 8 23:49:07 CST 2016
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2091347/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle INTERVAL YEAR TO MONTH 和INTERVAL DAY TO SECOND 資料型別Oracle資料型別
- 時間型別interval year to month型別
- Get n days before now
- New Year and Days
- MySQL內建函式:year()、 week()相容MySql函式
- CSS 巧用 :before和:afterCSS
- CSS巧用:before和:afterCSS
- css偽元素(before與after)CSS
- 偽元素 before 和 after 初探
- 理解偽元素 :before 和 :after
- before-after-hook鉤子函式Hook函式
- JUnit4 中@AfterClass @BeforeClass @after @before的區別對比
- Oracle INTERVAL DAY TO SECOND資料型別Oracle資料型別
- css當中:before和:after選擇器CSS
- ::after和::before 要配合content屬性
- 關於INTERVAL DAY TO SECOND資料型別資料型別
- flask 中的before_request 與 after_requFlask
- CSS-選擇器15-:before與:afterCSS
- js如何控制css偽元素內容(before,after)JSCSS
- css中的:before與:after的簡單使用CSS
- 瞭解css中偽元素 before和after的用法CSS
- 201012 Oracle OpenWorld Second DayOracle
- shell date 詳細用法 如date --date='1 month ago' '+%Y%m'Go
- jquery中append、prepend, before和after方法的區別jQueryAPP
- css after和before選擇器使用程式碼例項CSS
- 關於Oralce Trigger中before、after的區別
- Java中單元測試中:@BeforeClass,@Before,@Test,@After,@AfterClass中的問題詳解Java
- MONTH函式:函式
- css3偽元素選擇器before 和 after 的使用CSSS3
- javascript獲取偽物件before和after定義的內容JavaScript物件
- mysql觸發器案例分析以及before和after的區別MySql觸發器
- [20170315]資料型別interval day to second資料型別
- jquery_3monthjQuery
- 使用jiffies的時間比較函式time_after、time_before函式
- mini-lsm通關筆記Week1Day2筆記
- mini-lsm通關筆記Week1Day3筆記
- mini-lsm通關筆記Week1Day4筆記
- Spring Data JPA 報 HOUR_OF_DAY: 0 -> 1異常的解決過程和方案Spring