What is the appropriate way to set a duration in Java with standard Java libs? Date()? Calendar()? Example?
Thanks & Cheers ER
What is the appropriate way to set a duration in Java with standard Java libs? Date()? Calendar()? Example?
Thanks & Cheers ER
There is a de-facto standard for Java Date & time - JodaTime. It has Duration
. The JodaTime API is considered far better than Date
and Calendar
.
Of course, you can also store the duration in a long
- the milliseconds.