Get Date based on day count in Java

后端 未结 7 1099
感情败类
感情败类 2021-01-13 21:46

Simple Question, but Google surprisingly had little on this. I have the number of days from Jan 1st of the year. How can I convert that to a date i

相关标签:
7条回答
  • 2021-01-13 22:34

    I find JodaTime very elegant to use when it comes to date handling. With it, you could do it like this:

    DateTime date = new DateTime().withDayOfYear(dayOfYear);
    
    0 讨论(0)
提交回复
热议问题