I think I would use a GregorianCalendar to construct a date:
GregorianCalendar(int year, int month, int date, int hour, int minute, int second) Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale.
Then use the set() function of the Calendar class
set(int year, int month, int date) Sets the values for the fields year, month, and date.
To set the new year, month and day values.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database