Language

LocalTime.TruncatedTo(ITemporalUnit) Method

Definition

Returns a copy of this LocalTime with the time truncated.

[Android.Runtime.Register("truncatedTo", "(Ljava/time/temporal/TemporalUnit;)Ljava/time/LocalTime;", "", ApiSince=26)]
public Java.Time.LocalTime? TruncatedTo(Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("truncatedTo", "(Ljava/time/temporal/TemporalUnit;)Ljava/time/LocalTime;", "", ApiSince=26)>]
member this.TruncatedTo : Java.Time.Temporal.ITemporalUnit -> Java.Time.LocalTime

Parameters

unit
ITemporalUnit

the unit to truncate to, not null

Returns

a LocalTime based on this time with the time truncated, not null

Attributes

Remarks

Returns a copy of this LocalTime 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. This instance is immutable and unaffected by this method call.

Java reference for java.time.LocalTime.truncatedTo.

Applies to