Java: check if current date matches a specific date range

I am trying to determine in Java whether the current date is in the winter or summer semester.

Based on this, I want to build a specific JSON search for the current semester.

I have a very specific range for the winter semester:

Winter: 1.10.-15.02.

Summer: 1.3.-15.7.

Today: 12/15.

How can I check which semester interval to use?

-4
source share
1 answer

Create calendar objects for each date, set their fields, use the Calendar before and after methods to determine which current date of the range belongs

0
source

Source: https://habr.com/ru/post/1016550/


All Articles