-4

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

Based on this I want to construct a specific JSON retrieval of the current semester.

I have a very specific range for both winter an summer semester:

Winter: 1.10.-15.02.

Summer: 1.3.-15.7.

Today: 15.12.

How would i go about checking which semesters interval to use?

Community
  • 1
  • 1
  • Google and JavaDocs are a good start. – lea Dec 15 '14 at 10:34
  • See [my detailed answer](http://stackoverflow.com/a/30007159/642706) to a similar Question, [How to check if current date is between two reoccurring dates in java?](http://stackoverflow.com/q/29990001/642706). That question works with a month number & day-of-month number rather than full dates, which seems to be similar to this Question. – Basil Bourque May 03 '15 at 22:06

1 Answers1

0

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

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275