Java Dates and Periods

Period and Duration are not just alternatives, they work very
different. Duration is designed to work in exact measurements in
seconds and nanoseconds. However, Period calculates Days and Months
conception-wise ... that is some months can be 28,29,30, or 31 days,
and days can be 23, 24, or 25 hours long. So, if you add a Period of
1 Day, you always going to end up the next day same time. However, if
you add a Duration of 1 day (24 hours), then you can end up one hour
before or after, or same time depending on whether Daylight Saving
Time change was crossed

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.