Difference in date time

前端 未结 3 444
梦毁少年i
梦毁少年i 2021-01-24 10:21

I have 2 variables.

GMDCOMTM which stores the date time Tue Oct  1 13:32:40 2013
GMDRRSTM which stores the date time Tue Oct  2 23:35:33 2013

H

3条回答
  •  一整个雨季
    2021-01-24 11:03

    C=$(date -d "Tue Oct  1 13:32:40 2013" +%s)
    R=$(date -d "Tue Oct  2 23:35:33 2013" +%s)
    T=$(date --date=@$((R-C))  +%H:%M:%S)
    

提交回复
热议问题