Prathyusha Suggu
Prathyusha Suggu

Reputation: 49

I have the day of the year. How to obtain the date in shell script

example Day of the year: 305

how to get the date in dd-mm-yyyy format

Upvotes: 2

Views: 65

Answers (1)

tripleee
tripleee

Reputation: 189377

If you have GNU date (as implied by the tag) you can do

date -d "1/1 + 304 days" +%d-%m-%Y

Upvotes: 2

Related Questions