TimeHelper 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.
[Obsolete("Use the TimeUtils class instead.")]
public static class TimeHelper { }
Fields
Type | Name | Value | Summary |
---|---|---|---|
string | Iso8601DateFormat | yyyy-MM-ddTHH:mm:ssK |
ISO 8601 date format. |
Methods
GetAge(DateTime)
(static)
Gets the current age, from the specified date of birth. |
GetAge(DateTime, DateTime)
(static)
Gets the current age, from the specified date of birth. The age is calculated based on |
GetAge(EssentialsDateTime)
(static)
Gets the current age, from the specified date of birth. |
Gets the current age, from the specified date of birth. The age is calculated based on |
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 |
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 |
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(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 |
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(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 |
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. |
Gets the name of the month according to |
Gets the name of the month according to |
GetMonthName(DateTime)
(static)
Gets the English name of the month. |
GetMonthName(DateTimeOffset)
(static)
Gets the English name of the month. |
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 year is a leap year. |
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 |