How to detect if a date is within this or next week in java?

前端 未结 6 1075
醉酒成梦
醉酒成梦 2021-02-15 01:59

If I have a date of an event, such as 2011-01-03, how to detect if it is within this or next week in java ? Any sample code ?

Edit :

I thought it was a simple qu

6条回答
  •  走了就别回头了
    2021-02-15 02:35

    Hint: use Calendar. Create new instance of it for your sample event date. Then, compare WEEK_OF_YEAR for current date, and the date of your event.

提交回复
热议问题