IChronoZonedDateTime.With(ITemporalField, Int64) 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.
Returns an object of the same type as this object with the specified field altered.
[Android.Runtime.Register("with", "(Ljava/time/temporal/TemporalField;J)Ljava/time/chrono/ChronoZonedDateTime;", "GetWith_Ljava_time_temporal_TemporalField_JHandler:Java.Time.Chrono.IChronoZonedDateTimeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 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/chrono/ChronoZonedDateTime;", "GetWith_Ljava_time_temporal_TemporalField_JHandler:Java.Time.Chrono.IChronoZonedDateTimeInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member 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
an object of the same type with the specified field set, not null
Implements
- Attributes
Remarks
Returns an object of the same type as this object with the specified field altered. This returns a new object based on this one with the value for the specified field changed. For example, on a LocalDate, this could be used to set the year, month or day-of-month. The returned object will have the same observable type as this object. In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st January, then changing the month to February would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.
Java reference for java.time.chrono.ChronoZonedDateTime.with.