TimeHelper Class

Version 1.1.28
.NET Framework 4.8
This class has been marked as obsolete: Use the TimeUtils class instead.
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.

Gets the current age, from the specified date of birth. The age is calculated based on dt.

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 dt.

Returns the current Unix timestamp which is defined as the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns the current Unix timestamp which is defined as the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTime based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTime based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTime based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTime based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTimeOffset based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTimeOffset based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTimeOffset based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns an instance of DateTimeOffset based on the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Gets the English name of the day.

Gets the English name of the day.

Gets the day of the month along with the English ordinal suffix based on the specified date.

Gets the day of the month along with the English ordinal suffix based on the specified date.

Gets the English ordinal suffix of the day based on the specified date.

Gets the English ordinal suffix of the day based on the specified date.

Gets the elapsed seconds since the specified date.

Gets the elapsed seconds since the specified date.

Gets the first day of the month of the specified date.

Gets the first day of the month of the specified date.

Gets the first day of the week of the specified date. Monday is considered the first day of the week.

Gets the first day of the week of the specified date. Monday is considered the first day of the week.

Gets the first day of the week of the specified date and based on startOfWeek.

Gets the first day of the week of the specified date and based on startOfWeek.

Gets the first day of the month that matches dayOfWeek.

Gets the first day of the month that matches dayOfWeek.

Gets the first day of the month that matches dayOfWeek.

Gets the first day of the month that matches dayOfWeek.

Gets the first day of the month that matches dayOfWeek.

Gets the first day of the month that matches dayOfWeek.

Gets the week number of date according to the ISO 8601 specification.

Gets the week number of date according to the ISO 8601 specification.

Gets the last day of the month of the specified date.

Gets the last day of the month of the specified date.

Gets the last day of the week of the specified date. Monday is considered the first day of the week.

Gets the last day of the week of the specified date. Monday is considered the first day of the week.

Gets the last day of the week of the specified date and based on startOfWeek.

Gets the last day of the week of the specified date and based on startOfWeek.

Gets the last day of the month that matches dayOfWeek.

Gets the last day of the month that matches dayOfWeek.

Gets the last day of the month that matches dayOfWeek.

Gets the last day of the month that matches dayOfWeek.

Gets the last day of the month that matches dayOfWeek.

Gets the last day of the month that matches dayOfWeek.

Gets the name of the day according to the current culture.

Gets the name of the day according to the current culture.

Gets the name of the day according to culture.

Gets the name of the day according to culture.

Gets the name of the month according to the current culture.

Gets the name of the month according to the current culture.

Gets the name of the month according to culture.

Gets the name of the month according to culture.

Gets the English name of the month.

Gets the English name of the month.

Returns the Unix timestamp for the specified date. The Unix timestamp is defined as the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns the Unix timestamp for the specified date. The Unix timestamp is defined as the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns the Unix timestamp for the specified date. The Unix timestamp is defined as the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns the Unix timestamp for the specified date. The Unix timestamp is defined as the amount of seconds since the start of the Unix epoch - that is 1st of January, 1970 - 00:00:00 GMT.

Returns whether date is within the last number of specified days.

Returns whether date is within the last number of specified days.

Gets whether the specified date is a leap year.

Gets whether the specified date is a leap year.

IsLeapYear(int) (static)

Gets whether the specified year is a leap year.

Gets whether the specified date is a weekday.

Gets whether the specified date is a weekday.

Gets whether the specified date is in the weekend.

Gets whether the specified date is in the weekend.