Struct LocalTime
LocalTime is an immutable struct representing a time of day, with no reference
to a particular calendar, time zone or date.
Since 1.0.x
Availability net6.0, netstandard2.0
Assembly: NodaTime.dll
Syntax
[TypeConverter(typeof(LocalTimeTypeConverter))]
public readonly struct LocalTime : IEquatable<LocalTime>, IComparable<LocalTime>, IFormattable, IComparable, IXmlSerializable
Constructors
LocalTime(int, int, int, int)
Creates a local time at the given hour, minute, second and millisecond,
with a tick-of-millisecond value of zero.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime(int hour, int minute, int second, int millisecond)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of day. |
int |
minute |
The minute of the hour. |
int |
second |
The second of the minute. |
int |
millisecond |
The millisecond of the second. |
Exceptions
LocalTime(int, int, int)
Creates a local time at the given hour, minute and second,
with millisecond-of-second and tick-of-millisecond values of zero.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime(int hour, int minute, int second)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of day. |
int |
minute |
The minute of the hour. |
int |
second |
The second of the minute. |
Sample snippet
using NodaTime;
using System;
using System.Globalization;
LocalTime time = new LocalTime(16, 20, 0);
Console.WriteLine(time.ToString("HH:mm:ss", CultureInfo.InvariantCulture));
Output:
16:20:00
Exceptions
LocalTime(int, int)
Creates a local time at the given hour and minute, with second, millisecond-of-second
and tick-of-millisecond values of zero.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime(int hour, int minute)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of day. |
int |
minute |
The minute of the hour. |
Exceptions
Properties
ClockHourOfHalfDay
Gets the hour of the half-day of this local time, in the range 1 to 12 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public int ClockHourOfHalfDay { get; }
Property Value
Type |
Description |
int |
The hour of the half-day of this local time, in the range 1 to 12 inclusive. |
Hour
Gets the hour of day of this local time, in the range 0 to 23 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
Property Value
Type |
Description |
int |
The hour of day of this local time, in the range 0 to 23 inclusive. |
MaxValue
The maximum value of this type, one nanosecond before midnight.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime MaxValue { get; }
Property Value
Midnight
Local time at midnight, i.e. 0 hours, 0 minutes, 0 seconds.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime Midnight { get; }
Property Value
Millisecond
Gets the millisecond of this local time within the second, in the range 0 to 999 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public int Millisecond { get; }
Property Value
Type |
Description |
int |
The millisecond of this local time within the second, in the range 0 to 999 inclusive. |
Minute
Gets the minute of this local time, in the range 0 to 59 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public int Minute { get; }
Property Value
Type |
Description |
int |
The minute of this local time, in the range 0 to 59 inclusive. |
MinValue
The minimum value of this type; equivalent to
Midnight.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime MinValue { get; }
Property Value
NanosecondOfDay
Gets the nanosecond of this local time within the day, in the range 0 to 86,399,999,999,999 inclusive.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public long NanosecondOfDay { get; }
Property Value
Type |
Description |
long |
The nanosecond of this local time within the day, in the range 0 to 86,399,999,999,999 inclusive. |
NanosecondOfSecond
Gets the nanosecond of this local time within the second, in the range 0 to 999,999,999 inclusive.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public int NanosecondOfSecond { get; }
Property Value
Type |
Description |
int |
The nanosecond of this local time within the second, in the range 0 to 999,999,999 inclusive. |
Noon
Local time at noon, i.e. 12 hours, 0 minutes, 0 seconds.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime Noon { get; }
Property Value
Second
Gets the second of this local time within the minute, in the range 0 to 59 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public int Second { get; }
Property Value
Type |
Description |
int |
The second of this local time within the minute, in the range 0 to 59 inclusive. |
TickOfDay
Gets the tick of this local time within the day, in the range 0 to 863,999,999,999 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public long TickOfDay { get; }
Property Value
Type |
Description |
long |
The tick of this local time within the day, in the range 0 to 863,999,999,999 inclusive. |
TickOfSecond
Gets the tick of this local time within the second, in the range 0 to 9,999,999 inclusive.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public int TickOfSecond { get; }
Property Value
Type |
Description |
int |
The tick of this local time within the second, in the range 0 to 9,999,999 inclusive. |
Methods
Add(LocalTime, Period)
Adds the specified period to the time. Friendly alternative to operator+()
.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime Add(LocalTime time, Period period)
Parameters
Type |
Name |
Description |
LocalTime |
time |
The time to add the period to |
Period |
period |
The period to add. Must not contain any (non-zero) date units. |
Returns
Type |
Description |
LocalTime |
The sum of the given time and period |
AddSchema(XmlSchemaSet)
Adds the XML schema type describing the structure of the
LocalTime XML serialization to the given
xmlSchemaSet
.
the
xmlSchemaSet
.
Since 3.0.x
Availability net6.0, netstandard2.0
Declaration
public static XmlQualifiedName AddSchema(XmlSchemaSet xmlSchemaSet)
Parameters
Returns
Type |
Description |
XmlQualifiedName |
The qualified name of the schema type that was added to the xmlSchemaSet . |
CompareTo(LocalTime)
Indicates whether this time is earlier, later or the same as another one.
See the type documentation for a description of ordering semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public int CompareTo(LocalTime other)
Parameters
Type |
Name |
Description |
LocalTime |
other |
The other date/time to compare this one with |
Returns
Type |
Description |
int |
A value less than zero if this time is earlier than other ;
zero if this time is the same as other ; a value greater than zero if this time is
later than other . |
Deconstruct(out int, out int, out int)
Deconstruct this time into its components.
Since 2.3.x
Availability net6.0, netstandard2.0
Declaration
public void Deconstruct(out int hour, out int minute, out int second)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of the time. |
int |
minute |
The minute of the hour. |
int |
second |
The second within the minute. |
Equals(LocalTime)
Compares this local time with the specified one for equality.
See the type documentation for a description of equality semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public bool Equals(LocalTime other)
Parameters
Type |
Name |
Description |
LocalTime |
other |
The other local time to compare this one with |
Returns
Type |
Description |
bool |
True if the specified time is equal to this one; false otherwise |
Equals(object?)
Compares this local time with the specified reference.
See the type documentation for a description of equality semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public override bool Equals(object? obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare this one with |
Returns
Type |
Description |
bool |
True if the specified value is a local time which is equal to this one; false otherwise |
Overrides
FromHourMinuteSecondMillisecondTick(int, int, int, int, int)
Factory method to create a local time at the given hour, minute, second, millisecond and tick within millisecond.
Since 1.4.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromHourMinuteSecondMillisecondTick(int hour, int minute, int second, int millisecond, int tickWithinMillisecond)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of day. |
int |
minute |
The minute of the hour. |
int |
second |
The second of the minute. |
int |
millisecond |
The millisecond of the second. |
int |
tickWithinMillisecond |
The tick within the millisecond. |
Returns
Type |
Description |
LocalTime |
The resulting time. |
Exceptions
FromHourMinuteSecondNanosecond(int, int, int, long)
Factory method for creating a local time from the hour of day, minute of hour, second of minute, and nanosecond of second.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromHourMinuteSecondNanosecond(int hour, int minute, int second, long nanosecondWithinSecond)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of day in the desired time, in the range [0, 23]. |
int |
minute |
The minute of hour in the desired time, in the range [0, 59]. |
int |
second |
The second of minute in the desired time, in the range [0, 59]. |
long |
nanosecondWithinSecond |
The nanosecond within the second in the desired time, in the range [0, 999999999]. |
Returns
Type |
Description |
LocalTime |
The resulting time. |
Exceptions
FromHourMinuteSecondTick(int, int, int, int)
Factory method for creating a local time from the hour of day, minute of hour, second of minute, and tick of second.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromHourMinuteSecondTick(int hour, int minute, int second, int tickWithinSecond)
Parameters
Type |
Name |
Description |
int |
hour |
The hour of day in the desired time, in the range [0, 23]. |
int |
minute |
The minute of hour in the desired time, in the range [0, 59]. |
int |
second |
The second of minute in the desired time, in the range [0, 59]. |
int |
tickWithinSecond |
The tick within the second in the desired time, in the range [0, 9999999]. |
Returns
Type |
Description |
LocalTime |
The resulting time. |
Exceptions
Factory method for creating a local time from the number of hours which have elapsed since midnight.
Since 3.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromHoursSinceMidnight(int hours)
Parameters
Type |
Name |
Description |
int |
hours |
The number of hours, in the range [0, 23] |
Returns
Type |
Description |
LocalTime |
The resulting time. |
FromMillisecondsSinceMidnight(int)
Factory method for creating a local time from the number of milliseconds which have elapsed since midnight.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromMillisecondsSinceMidnight(int milliseconds)
Parameters
Type |
Name |
Description |
int |
milliseconds |
The number of milliseconds, in the range [0, 86,399,999] |
Returns
Type |
Description |
LocalTime |
The resulting time. |
FromMinutesSinceMidnight(int)
Factory method for creating a local time from the number of minutes which have elapsed since midnight.
Since 3.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromMinutesSinceMidnight(int minutes)
Parameters
Type |
Name |
Description |
int |
minutes |
The number of minutes, in the range [0, 1439] |
Returns
Type |
Description |
LocalTime |
The resulting time. |
FromNanosecondsSinceMidnight(long)
Factory method for creating a local time from the number of nanoseconds which have elapsed since midnight.
Since 3.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromNanosecondsSinceMidnight(long nanoseconds)
Parameters
Type |
Name |
Description |
long |
nanoseconds |
The number of nanoseconds, in the range [0, 86,399,999,999,999] |
Returns
Type |
Description |
LocalTime |
The resulting time. |
FromSecondsSinceMidnight(int)
Factory method for creating a local time from the number of seconds which have elapsed since midnight.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromSecondsSinceMidnight(int seconds)
Parameters
Type |
Name |
Description |
int |
seconds |
The number of seconds, in the range [0, 86,399] |
Returns
Type |
Description |
LocalTime |
The resulting time. |
FromTicksSinceMidnight(long)
Factory method for creating a local time from the number of ticks which have elapsed since midnight.
Since 1.1.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime FromTicksSinceMidnight(long ticks)
Parameters
Type |
Name |
Description |
long |
ticks |
The number of ticks, in the range [0, 863,999,999,999] |
Returns
Type |
Description |
LocalTime |
The resulting time. |
FromTimeOnly(TimeOnly)
Since 3.1.x
Availability net6.0
Declaration
public static LocalTime FromTimeOnly(TimeOnly time)
Parameters
Type |
Name |
Description |
TimeOnly |
time |
The time of day to convert. |
Returns
GetHashCode()
Returns a hash code for this local time.
See the type documentation for a description of equality semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public override int GetHashCode()
Returns
Type |
Description |
int |
A hash code for this local time. |
Overrides
Max(LocalTime, LocalTime)
Returns the later time of the given two.
Since 2.3.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime Max(LocalTime x, LocalTime y)
Parameters
Type |
Name |
Description |
LocalTime |
x |
The first time to compare. |
LocalTime |
y |
The second time to compare. |
Returns
Type |
Description |
LocalTime |
The later instant of x or y . |
Min(LocalTime, LocalTime)
Returns the earlier time of the given two.
Since 2.3.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime Min(LocalTime x, LocalTime y)
Parameters
Type |
Name |
Description |
LocalTime |
x |
The first time to compare. |
LocalTime |
y |
The second time to compare. |
Returns
Type |
Description |
LocalTime |
The earlier time of x or y . |
Minus(LocalTime)
Subtracts the specified time from this time, returning the result as a
Period.
Fluent alternative to
operator-()
.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public Period Minus(LocalTime time)
Parameters
Type |
Name |
Description |
LocalTime |
time |
The time to subtract from this |
Returns
Type |
Description |
Period |
The difference between the specified time and this one |
Minus(Period)
Subtracts the specified period from this time. Fluent alternative to operator-()
.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime Minus(Period period)
Parameters
Type |
Name |
Description |
Period |
period |
The period to subtract. Must not contain any (non-zero) date units. |
Returns
Type |
Description |
LocalTime |
The result of subtracting the given period from this time. |
On(LocalDate)
Since 1.3.x
Availability net6.0, netstandard2.0
Declaration
public LocalDateTime On(LocalDate date)
Parameters
Type |
Name |
Description |
LocalDate |
date |
The date to combine with this time |
Returns
Plus(Period)
Adds the specified period to this time. Fluent alternative to operator+()
.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime Plus(Period period)
Parameters
Type |
Name |
Description |
Period |
period |
The period to add. Must not contain any (non-zero) date units. |
Returns
Type |
Description |
LocalTime |
The sum of this time and the given period |
PlusHours(long)
Returns a new LocalTime representing the current value with the given number of hours added.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime PlusHours(long hours)
Parameters
Type |
Name |
Description |
long |
hours |
The number of hours to add |
Returns
Type |
Description |
LocalTime |
The current value plus the given number of hours. |
PlusMilliseconds(long)
Returns a new LocalTime representing the current value with the given number of milliseconds added.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime PlusMilliseconds(long milliseconds)
Parameters
Type |
Name |
Description |
long |
milliseconds |
The number of milliseconds to add |
Returns
Type |
Description |
LocalTime |
The current value plus the given number of milliseconds. |
PlusMinutes(long)
Returns a new LocalTime representing the current value with the given number of minutes added.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime PlusMinutes(long minutes)
Parameters
Type |
Name |
Description |
long |
minutes |
The number of minutes to add |
Returns
Type |
Description |
LocalTime |
The current value plus the given number of minutes. |
PlusNanoseconds(long)
Returns a new LocalTime representing the current value with the given number of nanoseconds added.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime PlusNanoseconds(long nanoseconds)
Parameters
Type |
Name |
Description |
long |
nanoseconds |
The number of nanoseconds to add |
Returns
Type |
Description |
LocalTime |
The current value plus the given number of ticks. |
PlusSeconds(long)
Returns a new LocalTime representing the current value with the given number of seconds added.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime PlusSeconds(long seconds)
Parameters
Type |
Name |
Description |
long |
seconds |
The number of seconds to add |
Returns
Type |
Description |
LocalTime |
The current value plus the given number of seconds. |
PlusTicks(long)
Returns a new LocalTime representing the current value with the given number of ticks added.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime PlusTicks(long ticks)
Parameters
Type |
Name |
Description |
long |
ticks |
The number of ticks to add |
Returns
Type |
Description |
LocalTime |
The current value plus the given number of ticks. |
Subtract(LocalTime, LocalTime)
Subtracts one time from another, returning the result as a
Period with units of years, months and days.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public static Period Subtract(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
The time to subtract from |
LocalTime |
rhs |
The time to subtract |
Returns
Type |
Description |
Period |
The result of subtracting one time from another. |
Subtract(LocalTime, Period)
Subtracts the specified period from the time. Friendly alternative to operator-()
.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime Subtract(LocalTime time, Period period)
Parameters
Type |
Name |
Description |
LocalTime |
time |
The time to subtract the period from |
Period |
period |
The period to subtract. Must not contain any (non-zero) date units. |
Returns
Type |
Description |
LocalTime |
The result of subtracting the given period from the time. |
ToString()
Returns a
String that represents this instance.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public override string ToString()
Returns
Type |
Description |
string |
The value of the current instance in the default format pattern ("T"), using the current thread's
culture to obtain a format provider.
|
Overrides
Formats the value of the current instance using the specified pattern.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public string ToString(string? patternText, IFormatProvider? formatProvider)
Parameters
Type |
Name |
Description |
string |
patternText |
The String specifying the pattern to use,
or null to use the default format pattern ("T").
|
IFormatProvider |
formatProvider |
The IFormatProvider to use when formatting the value,
or null to use the current thread's culture to obtain a format provider.
|
Returns
Type |
Description |
string |
A String containing the value of the current instance in the specified format.
|
ToTimeOnly()
Converts this value to an equivalent
TimeOnly.
Since 3.1.x
Availability net6.0
Declaration
public TimeOnly ToTimeOnly()
Returns
With(Func<LocalTime, LocalTime>)
Returns this time, with the given adjuster applied to it.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public LocalTime With(Func<LocalTime, LocalTime> adjuster)
Parameters
Returns
Type |
Description |
LocalTime |
The adjusted time. |
WithOffset(Offset)
Returns an
OffsetTime for this time-of-day with the given offset.
Since 2.3.x
Availability net6.0, netstandard2.0
Declaration
public OffsetTime WithOffset(Offset offset)
Parameters
Type |
Name |
Description |
Offset |
offset |
The offset to apply. |
Returns
Type |
Description |
OffsetTime |
The result of this time-of-day offset by the given amount. |
Operators
operator +(LocalTime, Period)
Creates a new local time by adding a period to an existing time. The period must not contain
any date-related units (days etc) with non-zero values.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime operator +(LocalTime time, Period period)
Parameters
Type |
Name |
Description |
LocalTime |
time |
The time to add the period to |
Period |
period |
The period to add |
Returns
Type |
Description |
LocalTime |
The result of adding the period to the time, wrapping via midnight if necessary |
operator ==(LocalTime, LocalTime)
Compares two local times for equality.
See the type documentation for a description of equality semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static bool operator ==(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
The first value to compare |
LocalTime |
rhs |
The second value to compare |
Returns
Type |
Description |
bool |
True if the two times are the same; false otherwise |
operator >(LocalTime, LocalTime)
Compares two LocalTime values to see if the left one is strictly later than the right one.
See the type documentation for a description of ordering semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static bool operator >(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
First operand of the comparison |
LocalTime |
rhs |
Second operand of the comparison |
Returns
Type |
Description |
bool |
true if the lhs is strictly later than rhs , false otherwise. |
operator >=(LocalTime, LocalTime)
Compares two LocalTime values to see if the left one is later than or equal to the right one.
See the type documentation for a description of ordering semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static bool operator >=(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
First operand of the comparison |
LocalTime |
rhs |
Second operand of the comparison |
Returns
Type |
Description |
bool |
true if the lhs is later than or equal to rhs , false otherwise. |
operator !=(LocalTime, LocalTime)
Compares two local times for inequality.
See the type documentation for a description of equality semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static bool operator !=(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
The first value to compare |
LocalTime |
rhs |
The second value to compare |
Returns
Type |
Description |
bool |
False if the two times are the same; true otherwise |
operator <(LocalTime, LocalTime)
Compares two LocalTime values to see if the left one is strictly earlier than the right one.
See the type documentation for a description of ordering semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static bool operator <(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
First operand of the comparison |
LocalTime |
rhs |
Second operand of the comparison |
Returns
Type |
Description |
bool |
true if the lhs is strictly earlier than rhs , false otherwise. |
operator <=(LocalTime, LocalTime)
Compares two LocalTime values to see if the left one is earlier than or equal to the right one.
See the type documentation for a description of ordering semantics.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static bool operator <=(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
First operand of the comparison |
LocalTime |
rhs |
Second operand of the comparison |
Returns
Type |
Description |
bool |
true if the lhs is earlier than or equal to rhs , false otherwise. |
operator -(LocalTime, LocalTime)
Subtracts one time from another, returning the result as a
Period.
Since 2.0.x
Availability net6.0, netstandard2.0
Declaration
public static Period operator -(LocalTime lhs, LocalTime rhs)
Parameters
Type |
Name |
Description |
LocalTime |
lhs |
The time to subtract from |
LocalTime |
rhs |
The time to subtract |
Returns
Type |
Description |
Period |
The result of subtracting one time from another. |
operator -(LocalTime, Period)
Creates a new local time by subtracting a period from an existing time. The period must not contain
any date-related units (days etc) with non-zero values.
This is a convenience operator over the
Minus(Period) method.
Since 1.0.x
Availability net6.0, netstandard2.0
Declaration
public static LocalTime operator -(LocalTime time, Period period)
Parameters
Type |
Name |
Description |
LocalTime |
time |
The time to subtract the period from |
Period |
period |
The period to subtract |
Returns
Type |
Description |
LocalTime |
The result of subtract the period from the time, wrapping via midnight if necessary |
Implements