how to get day of the year in shell?

后端 未结 2 794
名媛妹妹
名媛妹妹 2021-01-03 21:07

How can I get the day of the year in shell?

date \'+%V\' will give me the week of the year, which is 15 for today; but I need to find t

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 21:31

    Use the date command and the %j option...

    doy=$(date +%j)
    

提交回复
热议问题