Udostępnij za pośrednictwem


TemporalAdjusters.LastDayOfMonth Method

Definition

Returns the "last day of month" adjuster, which returns a new date set to the last day of the current month.

[Android.Runtime.Register("lastDayOfMonth", "()Ljava/time/temporal/TemporalAdjuster;", "", ApiSince=26)]
public static Java.Time.Temporal.ITemporalAdjuster? LastDayOfMonth ();
[<Android.Runtime.Register("lastDayOfMonth", "()Ljava/time/temporal/TemporalAdjuster;", "", ApiSince=26)>]
static member LastDayOfMonth : unit -> Java.Time.Temporal.ITemporalAdjuster

Returns

the last day-of-month adjuster, not null

Attributes

Remarks

Returns the "last day of month" adjuster, which returns a new date set to the last day of the current month.

The ISO calendar system behaves as follows:<br> The input 2011-01-15 will return 2011-01-31.<br> The input 2011-02-15 will return 2011-02-28.<br> The input 2012-02-15 will return 2012-02-29 (leap year).<br> The input 2011-04-15 will return 2011-04-30.

The behavior is suitable for use with most calendar systems. It is equivalent to:

long lastDay = temporal.range(DAY_OF_MONTH).getMaximum();
             temporal.with(DAY_OF_MONTH, lastDay);

Java documentation for java.time.temporal.TemporalAdjusters.lastDayOfMonth().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to