LocalDate.With Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| With(ITemporalAdjuster) |
Returns an adjusted copy of this date. |
| With(ITemporalField, Int64) |
Returns a copy of this date with the specified field set to a new value. |
With(ITemporalAdjuster)
Returns an adjusted copy of this date.
[Android.Runtime.Register("with", "(Ljava/time/temporal/TemporalAdjuster;)Ljava/time/LocalDate;", "", ApiSince=26)]
public Java.Time.LocalDate? With(Java.Time.Temporal.ITemporalAdjuster? adjuster);
[<Android.Runtime.Register("with", "(Ljava/time/temporal/TemporalAdjuster;)Ljava/time/LocalDate;", "", ApiSince=26)>]
member this.With : Java.Time.Temporal.ITemporalAdjuster -> Java.Time.LocalDate
Parameters
- adjuster
- ITemporalAdjuster
the adjuster to use, not null
Returns
a LocalDate based on this with the adjustment made, not null
- Attributes
Remarks
Returns an adjusted copy of this date. This returns a LocalDate, based on this one, with the date adjusted. The adjustment takes place using the specified adjuster strategy object. Read the documentation of the adjuster to understand what adjustment will be made. A simple adjuster might simply set the one of the fields, such as the year field. A more complex adjuster might set the date to the last day of the month. A selection of common adjustments is provided in TemporalAdjusters. These include finding the "last day of the month" and "next Wednesday". Key date-time classes also implement the TemporalAdjuster interface, such as Month and MonthDay. The adjuster is responsible for handling special cases, such as the varying lengths of month and leap years. For example this code returns a date on the last day of July: The result of this method is obtained by invoking the TemporalAdjuster.adjustInto(Temporal) method on the specified adjuster passing this as the argument. This instance is immutable and unaffected by this method call.
Java reference for java.time.LocalDate.with.
Applies to
With(ITemporalField, Int64)
Returns a copy of this date with the specified field set to a new value.
[Android.Runtime.Register("with", "(Ljava/time/temporal/TemporalField;J)Ljava/time/LocalDate;", "", ApiSince=26)]
public Java.Time.Temporal.ITemporal? With(Java.Time.Temporal.ITemporalField? field, long newValue);
[<Android.Runtime.Register("with", "(Ljava/time/temporal/TemporalField;J)Ljava/time/LocalDate;", "", ApiSince=26)>]
abstract member With : Java.Time.Temporal.ITemporalField * int64 -> Java.Time.Temporal.ITemporal
override this.With : Java.Time.Temporal.ITemporalField * int64 -> Java.Time.Temporal.ITemporal
Parameters
- field
- ITemporalField
the field to set in the result, not null
- newValue
- Int64
the new value of the field in the result
Returns
a LocalDate based on this with the specified field set, not null
Implements
- Attributes
Remarks
To be added.
Java reference for java.time.LocalDate.with.