Unable to set just year with Linux date command [closed]

喜欢而已 提交于 2019-12-08 07:16:27

Apparently to change the date you have to use the complete setting syntax.

date --set="YYYYmmdd HH:MM"

Here is a way to achieve your demand :

date --set="$(date +'2013%m%d %H:%M')"

This way you maintain month, day, hour and minute and change year.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!