how can I convert day of year to date in javascript?

后端 未结 9 1054
一整个雨季
一整个雨季 2020-11-30 08:48

I want to take a day of the year and convert to an actual date using the Date object. Example: day 257 of 1929, how can I go about doing this?

9条回答
  •  醉话见心
    2020-11-30 09:37

    If I understand your question correctly, you can do that from the Date constructor like this

    new Date(year, month, day, hours, minutes, seconds, milliseconds)
    

    All arguments as integers

提交回复
热议问题