TimeUtils Class
| Namespace | Skybrud.Essentials.Time |
|---|---|
| Assembly | Skybrud.Essentials.dll |
| Visibility | Public |
| Keywords | Static |
| Inheritance | Object |
Utility class with various static helper methods for working with date and time.
public static class TimeUtils { }
Fields
| Type | Name | Value | Summary |
|---|---|---|---|
| string | Iso8601DateFormat | yyyy-MM-ddTHH:mm:ssK |
ISO 8601 date format. |
Methods
|
GetAbbreviatedDayName(DayOfWeek)
(static)
Gets the abbreviated English name of the day. |
|
GetAbbreviatedDayName(DateTime)
(static)
Gets the abbreviated English name of the day. |
|
Gets the abbreviated English name of the day. |
|
Gets the abbreviated name of the day according to the current culture. |
|
GetAbbreviatedLocalDayName(DateTime)
(static)
Gets the abbreviated name of the day according to the current culture. |
|
Gets the abbreviated name of the day according to the current culture. |
|
Gets the abbreviated name of the day according to |
|
Gets the abbreviated name of the day according to |
|
Gets the abbreviated name of the day according to |
|
GetAbbreviatedLocalMonthName(int)
(static)
Gets the abbreviated name of the |
|
Gets the abbreviated name of the month according to the current culture. |
|
Gets the abbreviated name of the month according to the current culture. |
|
Gets the abbreviated name of the month according to |
|
Gets the abbreviated name of the month according to |
|
Gets the abbreviated name of the month according to |
|
GetAbbreviatedMonthName(int)
(static)
Gets the abbreviated English name of the specified |
|
GetAbbreviatedMonthName(DateTime)
(static)
Gets the abbreviated English name of the month. |
|
Gets the abbreviated English name of the month. |
|
GetAge(DateTime, int, int, int)
(static)
Returns the age as calculated between |
|
GetAge(int, int, int, int, int, int)
(static)
Returns the age as calculated between two dates. |
|
GetAge(DateTime)
(static)
Returns the age as calculated between |
|
GetAge(DateTime, DateTime)
(static)
Gets the current age, from the specified |
|
GetAge(DateTime, DateTimeOffset)
(static)
Gets the current age, from the specified |
|
GetAge(DateTime, EssentialsDate)
(static)
Gets the current age, from the specified |
|
GetAge(DateTime, EssentialsDateTime)
(static)
Gets the current age, from the specified |
|
GetAge(DateTime, EssentialsTime)
(static)
Gets the current age, from the specified |
|
GetAge(DateTimeOffset)
(static)
Returns the age as calculated between |
|
GetAge(DateTimeOffset, DateTime)
(static)
Returns the age, from the specified |
|
Returns the age, from the specified |
|
Gets the current age, from the specified |
|
Gets the current age, from the specified |
|
Gets the current age, from the specified |
|
GetAge(EssentialsDate)
(static)
Returns the age as calculated between |
|
GetAge(EssentialsDate, DateTime)
(static)
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
GetAge(EssentialsDateTime)
(static)
Returns the age as calculated between |
|
GetAge(EssentialsDateTime, DateTime)
(static)
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
GetAge(EssentialsTime)
(static)
Returns the age as calculated between |
|
GetAge(EssentialsTime, DateTime)
(static)
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
Returns the age as calculated between the two dates |
|
GetCurrentUnixTimestamp()
(static)
Returns the current Unix timestamp which is defined as the amount of seconds since the start of the Unix
epoch - that is |
|
GetCurrentUnixTimestampAsDouble()
(static)
Returns the current Unix timestamp which is defined as the amount of seconds since the start of the Unix
epoch - that is |
|
GetDateTimeFromIso8601Week(int, int)
(static)
Gets an instance of DateTime representing the start of the specified
ISO 8601 |
|
GetDateTimeFromUnixTime(int)
(static)
Returns an instance of DateTime based on the amount of seconds since the start of the Unix
epoch - that is |
|
GetDateTimeFromUnixTime(long)
(static)
Returns an instance of DateTime based on the amount of seconds since the start of the Unix
epoch - that is |
|
GetDateTimeFromUnixTime(double)
(static)
Returns an instance of DateTime based on the amount of seconds since the start of the Unix
epoch - that is |
|
GetDateTimeFromUnixTime(string)
(static)
Returns an instance of DateTime based on the amount of seconds since the start of the Unix
epoch - that is |
|
Gets an instance of DateTimeOffset representing the start of the specified ISO 8601 |
|
Gets an instance of DateTimeOffset representing the start of the specified ISO 8601 |
|
GetDateTimeOffsetFromUnixTime(int)
(static)
Returns an instance of DateTimeOffset based on the amount of seconds since the start of the
Unix epoch - that is |
|
GetDateTimeOffsetFromUnixTime(long)
(static)
Returns an instance of DateTimeOffset based on the amount of seconds since the start of the
Unix epoch - that is |
|
Returns an instance of DateTimeOffset based on the amount of seconds since the start of the
Unix epoch - that is |
|
Returns an instance of DateTimeOffset based on the amount of seconds since the start of the
Unix epoch - that is |
|
GetDayName(DayOfWeek)
(static)
Gets the English name of the day. |
|
GetDayName(DateTime)
(static)
Gets the English name of the day. |
|
GetDayName(DateTimeOffset)
(static)
Gets the English name of the day. |
|
GetDayNumberAndSuffix(DateTime)
(static)
Gets the day of the month along with the English ordinal suffix based on the specified
|
|
Gets the day of the month along with the English ordinal suffix based on the specified
|
|
GetDaySuffix(DateTime)
(static)
Gets the English ordinal suffix of the day based on the specified |
|
GetDaySuffix(DateTimeOffset)
(static)
Gets the English ordinal suffix of the day based on the specified |
|
GetElapsedSeconds(DateTime)
(static)
Gets the elapsed seconds since the specified |
|
GetElapsedSeconds(DateTimeOffset)
(static)
Gets the elapsed seconds since the specified |
|
GetEndOfDay(DateTimeOffset)
(static)
|
|
GetEndOfMonth(DateTimeOffset)
(static)
|
|
GetEndOfWeek(DateTimeOffset)
(static)
|
|
GetFirstDayOfMonth(DateTime)
(static)
Gets the first day of the month of the specified |
|
GetFirstDayOfMonth(DateTimeOffset)
(static)
Gets the first day of the month of the specified |
|
GetFirstDayOfWeek(DateTime)
(static)
Gets the first day of the week of the specified |
|
GetFirstDayOfWeek(DateTimeOffset)
(static)
Gets the first day of the week of the specified |
|
Gets the first day of the week of the specified |
|
Gets the first day of the week of the specified |
|
Gets the first day of the month that matches |
|
Gets the first day of the month that matches |
|
Gets the first day of the month that matches |
|
Gets the first day of the month that matches |
|
Gets the first day of the month that matches |
|
Gets the first day of the month that matches |
|
GetIso8601WeekNumber(DateTime)
(static)
Gets the week number of |
|
GetIso8601WeekNumber(DateTimeOffset)
(static)
Gets the week number of |
|
GetLastDayOfMonth(DateTime)
(static)
Gets the last day of the month of the specified |
|
GetLastDayOfMonth(DateTimeOffset)
(static)
Gets the last day of the month of the specified |
|
GetLastDayOfWeek(DateTime)
(static)
Gets the last day of the week of the specified |
|
GetLastDayOfWeek(DateTimeOffset)
(static)
Gets the last day of the week of the specified |
|
Gets the last day of the week of the specified |
|
Gets the last day of the week of the specified |
|
Gets the last day of the month that matches |
|
Gets the last day of the month that matches |
|
Gets the last day of the month that matches |
|
Gets the last day of the month that matches |
|
Gets the last day of the month that matches |
|
Gets the last day of the month that matches |
|
GetLocalDayName(DayOfWeek)
(static)
Gets the name of the day according to the current culture. |
|
GetLocalDayName(DateTime)
(static)
Gets the name of the day according to the current culture. |
|
GetLocalDayName(DateTimeOffset)
(static)
Gets the name of the day according to the current culture. |
|
Gets the name of the day according to |
|
Gets the name of the day according to |
|
Gets the name of the day according to |
|
GetLocalMonthName(int)
(static)
Gets the name of the |
|
GetLocalMonthName(DateTime)
(static)
Gets the name of the month according to the current culture. |
|
GetLocalMonthName(DateTimeOffset)
(static)
Gets the name of the month according to the current culture. |
|
GetLocalMonthName(int, CultureInfo)
(static)
Gets the name of the month according to |
|
Gets the name of the month according to |
|
Gets the name of the month according to |
|
GetMonthName(int)
(static)
Gets the English name of the specified |
|
GetMonthName(DateTime)
(static)
Gets the English name of the month. |
|
GetMonthName(DateTimeOffset)
(static)
Gets the English name of the month. |
|
GetStartOfDay(DateTimeOffset)
(static)
|
|
GetStartOfMonth(DateTimeOffset)
(static)
|
|
GetStartOfWeek(DateTimeOffset)
(static)
|
|
GetUnixTimeFromDateTime(DateTime)
(static)
Returns the Unix timestamp for the specified |
|
Returns the Unix timestamp for the specified |
|
Returns the Unix timestamp for the specified |
|
Returns the Unix timestamp for the specified |
|
IsDateWithinLastDays(DateTime, int)
(static)
Returns whether |
|
Returns whether |
|
IsLeapYear(DateTime)
(static)
Gets whether the specified |
|
IsLeapYear(DateTimeOffset)
(static)
Gets whether the specified |
|
IsLeapYear(int)
(static)
Gets whether the specified |
|
Iso8601ToDateTime(string)
(static)
Converts the specified |
|
Iso8601ToDateTimeOffset(string)
(static)
Converts the specified |
|
IsWeekday(DateTime)
(static)
Gets whether the specified |
|
IsWeekday(DateTimeOffset)
(static)
Gets whether the specified |
|
IsWeekend(DateTime)
(static)
Gets whether the specified |
|
IsWeekend(DateTimeOffset)
(static)
Gets whether the specified |
|
NormalizeRfc822TimeZone(string)
(static)
The RFC 822 specification describes a number of predefined time zones - eg. |
|
ParseEnumFromMonthName(string)
(static)
Converts the specified |
|
Converts the specified |
|
ParseNumberFromMonthName(string)
(static)
Converts the specified |
|
Converts the specified |
|
Rfc822ToDateTime(string)
(static)
Converts the specified |
|
Rfc822ToDateTimeOffset(string)
(static)
Converts the specified |
|
ToFormat(DateTime, TimeFormat)
(static)
|
|
ToFormat(EssentialsDate, TimeFormat)
(static)
|
|
ToFormat(DateTimeOffset, TimeFormat)
(static)
|
|
ToIso8601(DateTime)
(static)
Converts the specified |
|
ToIso8601(DateTimeOffset)
(static)
Converts the specified |
|
ToIso8601(EssentialsDateTime)
(static)
Converts the specified |
|
ToRfc2822(DateTime)
(static)
Converts the specified |
|
ToRfc2822(DateTimeOffset)
(static)
Converts the specified |
|
ToRfc2822(EssentialsDateTime)
(static)
Converts the specified |
|
ToRfc822(DateTime)
(static)
Converts the specified |
|
ToRfc822(DateTimeOffset)
(static)
Converts the specified |
|
ToRfc822(EssentialsDateTime)
(static)
Converts the specified |
|
Converts the specified |
|
Converts the specified |
|
Converts the specified |
|
Converts the specified |