Belows are example use of date command:
To get yesterday time:
$ date --date="1 days ago"or
$ date --date="-1 days"
To get one month ago:
$ date --date="1 months ago"or
$ date --date="-1 months"
To get one hour ago:
$ date --date="1 hours ago"or
$ date --date="-1 hours"
To get one minutes in the future:
$ date --date="+1 minutes"
To get one seconds in the future:
$ date --date="+1 seconds"
We can also combine it, example to get one month and two hours ago:
$ date --date="1 month 2 hours ago"or
$ date --date="-1 month -2 hours"
There are many other ways to express the particular time.
That's all :)
This comment has been removed by a blog administrator.
ReplyDelete