Search code examples
linuxbashshellksh

how to get day of the year in shell?


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 the day of the year!


Solution

  • From the coreutils date manual:

    %j     day of year (001..366)