EssentialsDate Class

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Time
Assembly Skybrud.Essentials.dll
Visibility Public
Interfaces IComparable , IComparable<T>
Inheritance Object

Class representing a date without a time.

public class EssentialsDate : IComparable, IComparable<T> { }

Properties

Type Name Summary
int Year

Gets the year.

int Month

Gets the month.

int Day

Gets the day.

DayOfWeek DayOfWeek

Returns the day-of-week part of this EssentialsDate. The returned value is an integer between 0 and 6, where 0 indicates Sunday, 1 indicates Monday, 2 indicates Tuesday, 3 indicates Wednesday, 4 indicates Thursday, 5 indicates Friday, and 6 indicates Saturday.

int DayOfYear

Gets the day-of-year part of this EssentialsDate. The returned value is an integer between 1 and 366.

int YearAndDay

Returns a numeric value representing both the year and date.

bool IsLeapYear

Gets whether the year of this EssentialsDate is a leap year.

bool IsWeekend

Gets whether the day of this EssentialsDate is within a weekend.

bool IsWeekday

Gets whether the day of this EssentialsDate is a weekday.

int WeekNumber

Gets the week number the ISO 8601 week of this EssentialsDate.

int DaysInMonth

Gets the amount of days in the month.

String DaySuffix

Gets the English ordinal suffix of the day.

String Iso8601

Gets a string representation of the instance as specified by the ISO 8601 format.

bool IsToday

Gets whether the date is today.

EssentialsDate Today

Gets an instance of EssentialsDate representing the current day.

Methods

Returns a new EssentialsDate that adds the specified number of days to the value of this instance.

Compares the value of this instance to a specified EssentialsDate value and returns an integer that indicates whether this instance is lower than, the same as, or greater than the specified EssentialsDate value.

Compares the value of this instance to a specified DateTime value and returns an integer that indicates whether this instance is lower than, the same as, or greater than the specified DateTime value.

Compares the value of this instance to a specified DateTimeOffset value and returns an integer that indicates whether this instance is lower than, the same as, or greater than the specified DateTimeOffset value.

Compares the value of this instance to a specified EssentialsTime value and returns an integer that indicates whether this instance is lower than, the same as, or greater than the specified EssentialsTime value.

CompareTo(object) (virtual)

Compares the value of this instance to a specified object that contains a EssentialsDate value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified EssentialsDate value.

Gets whether this EssentialsDate equals the specified date.

Equals(object) (virtual)

Gets whether this EssentialsDate equals the specified obj.

Returns the amount of days between a and b.

Notice: if b is a date before a, the result will be a negative numbers.

Gets the end of the day, according to Coordinated Universal Time (UTC).

Gets the end of the day, according to the specified timeZone.

Gets the end of the month, according to Coordinated Universal Time (UTC).

Gets the end of the month, according to the specified timeZone.

Gets the end of the week, according to Coordinated Universal Time (UTC).

Gets the end of the day, according to the specified timeZone.

GetHashCode() (virtual)

Gets the hash code for this EssentialsDate.

Gets the start of the day, according to Coordinated Universal Time (UTC).

Gets the start of the day, according to the specified timeZone.

Gets the start of the day, according to Coordinated Universal Time (UTC).

Gets the start of the day, according to the specified timeZone.

Gets the start of the week, according to Coordinated Universal Time (UTC).

Gets the start of the week, according to the specified timeZone.

Gets whether the dates represented by two instances of EssentialsDate are equal.

Gets whether d1 is greater than d2.

Gets whether d1 is greater than d2.

Gets whether d1 is greater than d2.

Gets whether d1 is greater than d2.

Gets whether d1 is greater than or equal to d2.

Gets whether d1 is greater than or equal to d2.

Gets whether d1 is greater than or equal to d2.

Gets whether d1 is greater than or equal to d2.

Gets whether the dates represented by two instances of EssentialsDate are different from each other.

Gets whether d1 is less than d2.

Gets whether d1 is less than d2.

Gets whether d1 is less than d2.

Gets whether d1 is less than d2.

Gets whether d1 is less than or equal to d2.

Gets whether d1 is less than or equal to d2.

Gets whether d1 is less than or equal to d2.

Gets whether d1 is less than or equal to d2.

Parse(string) (static)

Converts the string representation of a date to its EssentialsDate equivalent by using the conventions of the current thread culture.

Converts the string representation of a date to its EssentialsDate equivalent by using culture-specific format information.

Converts the string representation of a dat to its EssentialsDate equivalent by using culture-specific format information and a formatting style.

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly or an exception is thrown.

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly or an exception is thrown.

ToString() (virtual)

Returns a string representation of the date.

Converts the value of the current EssentialsDate to its equivalent string representation using the specified format.

Converts the value of the current EssentialsDate to its equivalent string representation using the specified format and provider.

Tries to convert a specified string representation of a date to its EssentialsTime equivalent, and returns a value that indicates whether the conversion succeeded.

Tries to convert a specified string representation of a date to its EssentialsTime equivalent, and returns a value that indicates whether the conversion succeeded.

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. The method returns a value that indicates whether the conversion succeeded.

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly. The method returns a value that indicates whether the conversion succeeded.