次の方法で共有


DateTimeUtil Class

Definition

Utility class for performing operations involving DateTime and TimeSpan.

public static class DateTimeUtil
type DateTimeUtil = class
Public Class DateTimeUtil
Inheritance
DateTimeUtil

Methods

Add(DateTime, TimeSpan)

Adds a DateTime and a TimeSpan. If the resulting value exceeds MaxValue, returns MaxValue. If the resulting value is less than MinValue, returns MinValue.

GetMaxValue(DateTimeKind)

Gets the maximum value for a DateTime with the specified DateTimeKind.

GetMinValue(DateTimeKind)

Gets the minimum value for a DateTime with the specified DateTimeKind.

ToUniversalTime(DateTime)

Converts the specified DateTime to UTC if it is not already in UTC.

ToUniversalTime(Nullable<DateTime>)

Converts the specified DateTime to UTC if it is not already in UTC.

Applies to