OffsetDateTime.TruncatedTo(ITemporalUnit) 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 a copy of this OffsetDateTime with the time truncated.
[Android.Runtime.Register("truncatedTo", "(Ljava/time/temporal/TemporalUnit;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public Java.Time.OffsetDateTime? TruncatedTo(Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("truncatedTo", "(Ljava/time/temporal/TemporalUnit;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
member this.TruncatedTo : Java.Time.Temporal.ITemporalUnit -> Java.Time.OffsetDateTime
Parameters
- unit
- ITemporalUnit
the unit to truncate to, not null
Returns
an OffsetDateTime based on this date-time with the time truncated, not null
- Attributes
Remarks
Returns a copy of this OffsetDateTime with the time truncated. Truncation rounds the time down to a multiple of the unit within a standard day. For example, truncating with the minutes unit will set the second-of-minute and nano-of-second field to zero. The unit must have a duration that divides into the length of a standard day without remainder. This includes all supplied time units on ChronoUnit and DAYS. Other ChronoUnit values throw an exception. The offset does not affect the calculation and will be the same in the result. This instance is immutable and unaffected by this method call.
Java reference for java.time.OffsetDateTime.truncatedTo.