How to get start and end date of a year?

前端 未结 15 1771
清酒与你
清酒与你 2021-02-05 02:57

I have to use the Java Date class for this problem (it interfaces with something out of my control).

How do I get the start and end date of a year and then

15条回答
  •  悲&欢浪女
    2021-02-05 03:09

    You can use Jodatime as shown in this thread Java Joda Time - Implement a Date range iterator

    Also, you can use gregorian calendar and move one day at a time, as shown here. I need a cycle which iterates through dates interval

    PS. Piece of advice: search it first.

提交回复
热议问题