Display by specifying date and time
# date -d '10 days' "+%Y/%m/%d %H:%M:%S"
2013/11/13 10:02:43
- Display date and time after 10 days
# date -d '5 days ago' "+%Y/%m/%d %H:%M:%S"
2013/10/29 10:03:36
- Display date and time 5 days ago
# date -d '-112 days' "+%Y/%m/%d %H:%M:%S"
2013/07/14 11:19:21
- Display date and time 112 days ago
# date -d 'yesterday' "+%Y/%m/%d %H:%M:%S"
2013/11/02 11:20:28
- Display yesterday's date and time
# date -d 'tomorrow' "+%Y/%m/%d %H:%M:%S"
2013/11/04 11:21:16
- Display tomorrow's date and time
# date -d 'week ago' "+%Y/%m/%d %H:%M:%S"
2013/10/27 11:22:42
- Display date and time from 1 week ago
# date -d '3 month' "+%Y/%m/%d %H:%M:%S"
2014/02/03 11:25:15
- Display date and time 3 months from now
# date -d '2 year 5 month 17 days 7 hour' "+%Y/%m/%d %H:%M:%S"
2016/04/20 18:49:40
- Display date and time 2 years 5 months 17 days 7 hours later
# date -d 'TZ="America/Los_Angeles" next Fri' "+%Y/%m/%d %H:%M:%S"
2013/11/03 16:00:00
- Show date and time for next Friday in US Los_Angeles
# date -d '@1384978767' "+%Y/%m/%d %H:%M:%S"
2013/11/21 05:19:27
- Display date and time in specified UNIX Time
# date -d '20140701' "+%A"
Tuesday
- Display the day of the week for the specified date
|