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

前端 未结 7 1047
误落风尘
误落风尘 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:30

    TZ=Asia/Calcutta date should work (obviously this will get you the time in Calcutta).

    This changes your TimeZone (TZ) environment variable for this operation only, it won't permanently set you to the new time zone you specify.

提交回复
热议问题