Add some specific time while using the linux command “date”

前端 未结 7 1025
误落风尘
误落风尘 2021-01-07 20:18

In linux, date can help me to print the current time. If want to print the current time + 1 hour, what option should I give?

7条回答
  •  既然无缘
    2021-01-07 20:46

    In shell script, if we need to add time then use below command and date format(PUT TIME before DATE string)

    date -d"11:15:10 2017-02-05 +2 hours" +"%Y-%m-%d %H:%M:%S" this will output 2017-02-05 13:15:10

    THis does not result in correct date without UTC it does not work

提交回复
热议问题