Java Reference
In-Depth Information
Table 12.3 provides a list of the TemporalAdjusters that can be created with these factory
methods.
Table 12.3. The factory methods of the TemporalAdjusters class
Method
Description
dayOfWeekInMonth
Creates a new date in the same month with the ordinal day of week
firstDayOfMonth
Creates a new date set to the first day of the current month
firstDayOfNextMonth
Creates a new date set to the first day of the next month
firstDayOfNextYear
Creates a new date set to the first day of the next year
firstDayOfYear
Creates a new date set to the first day of the current year
firstInMonth
Creates a new date in the same month with the first matching day of week
lastDayOfMonth
Creates a new date set to the last day of the current month
lastDayOfNextMonth
Creates a new date set to the last day of the next month
lastDayOfNextYear
Creates a new date set to the last day of the next year
lastDayOfYear
Creates a new date set to the last day of the current year
lastInMonth
Creates a new date in the same month with the last matching day of week
next previous
Creates a new date set to the first occurrence of the specified day of week
after/before the date being adjusted
nextOrSame
Creates a new date set to the first occurrence of the specified day of week
previousOrSame
after/before the date being adjusted unless it's already on that day, in which case
the same object is returned
As you can see, TemporalAdjusters allow you to perform more complex date manipulations that
still read like the problem statement. Moreover, it's relatively simple to create your own custom
TemporalAdjuster implementation if you can't find a predefined TemporalAdjuster that fits your
 
Search WWH ::




Custom Search