Reduce or Increase a date to a given start or end of a TimeUnit granularity.
This allows you to modify a date to reset to minimum or maximum values all values below a given TimeUnit granulariy.
This operates in local time zone so if you are not in UTC time zone and you output date in UTC time zone the datefields will not be to the start or end of the TimeUnit.
Example TimeUnit.startOfTime Hour date will return a modified date with
Example TimeUnit.endOfTime Hour date will return a modified date with
Return a date created by increasing to maximum value all values below a given TimeUnit granularity.
This modifies in local time zone values, as the date element parts are pulled straight from the local time zone date values.
Date granularity of operations.
Warning about using endOfTime for date ranges
In the past when I have encountered people using a function like endOfTime (max date at a given granularity) it was being used in ways that could introduce problems.
Here is why.
Copyright (c) 2016 Robin Luiten
Return a date created by reducing to minimum value all values below a given TimeUnit granularity.
This modifies date in local time zone values, as the date element parts are pulled straight from the local time zone date values.