Class DateUtils
Contains static methods related to DateTime.
public static class DateUtils
- Inheritance
-
DateUtils
Fields
- AmDesignatorOverride
Gets or sets the designator override for AM/PM formatting in time representations.
- PmDesignatorOverride
Gets or sets the designator override for PM formatting in time representations.
Properties
- DateFormatJs
Gets DateTime format used in JavaScript or in other situations.
Methods
- GetAbsDistanceWithNow(long)
Subtracts ticks of Now with the specified timestamp and gets absolute value of the result.
- GetAmOrPmDesignator(DateTime, IFormatProvider?)
Returns the culture-specific AM or PM designator for the specified date and time value.
- GetAmPmDesignators(IFormatProvider?)
Gets the localized AM and PM designators from the specified format provider, or uses the current culture if the provider is
null.
- GetCurrentTimestamp()
Gets the current timestamp in ticks.
- GetFormatInfo(IFormatProvider?)
Gets the DateTimeFormatInfo from the specified format provider, or uses the current culture if the provider is
null.
- GetNowInMilliseconds()
Gets current time in milliseconds.
- GetNowInUnixMilliseconds()
Gets current time in milliseconds using ToUnixTimeMilliseconds().
- GetTimeSeparator(IFormatProvider?)
Gets the localized time separator from the specified format provider, or uses the current culture if the provider is
null.
- HasAmPmDesignators(IFormatProvider?)
Returns
trueif the specified format provider has AM or PM designators and 12 hour time format can be used.
- IsAM(DateTime)
Determines whether the specified time is in the morning (ante meridiem, AM).
- TicksFromMilliseconds(long)
Converts milliseconds to ticks.
- TicksToMilliseconds(long)
Converts ticks to milliseconds.