EssentialsDateTime Class

Version 1.1.28
.NET Framework 4.8
This class has been marked as obsolete: Use EssentialsTime class instead.
Namespace Skybrud.Essentials.Time
Assembly Skybrud.Essentials.dll
Visibility Public
Interfaces IComparable , IComparable<T>, IComparable<T>
Inheritance Object

Class wrapping an instance of EssentialsDateTime.DateTime (as an alternative to using Nullable<T>).

[Obsolete("Use EssentialsTime class instead.")]
public class EssentialsDateTime : IComparable, IComparable<T>, IComparable<T> { }

Properties

Type Name Summary
EssentialsDateTime Now

Gets a EssentialsDateTime object that is set to the current date and time on this computer, expressed as the local time.

long CurrentUnixTimestamp

Gets the current UNIX timestamp (amount of seconds since the start of the Unix Epoch).

EssentialsDateTime Zero

Gets an instance of EssentialsDateTime representing the start of the Unix Epoch (AKA 0 seconds).

EssentialsDateTime Today

Gets the current date.

EssentialsDateTime UtcNow

Gets a EssentialsDateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).

DateTime DateTime

Gets the wrapped EssentialsDateTime.DateTime.

int Day

Returns the day-of-month part of this EssentialsDateTime. The returned value is an integer between 1 and 31.

DayOfWeek DayOfWeek

Returns the day-of-week part of this EssentialsDateTime. 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 EssentialsDateTime. The returned value is an integer between 1 and 366.

int Hour

Gets the hour part of this EssentialsDateTime. The returned value is an integer between 0 and 23.

DateTimeKind Kind

Gets the kind of the underlying EssentialsDateTime.DateTime.

int Millisecond

Gets the millisecond part of this EssentialsDateTime. The returned value is an integer between 0 and 999.

int Minute

Gets the minute part of this EssentialsDateTime. The returned value is an integer between 0 and 59.

int Month

Gets the month part of this EssentialsDateTime. The returned value is an integer between 1 and 12.

int Second

Gets the second part of this EssentialsDateTime. The returned value is an integer between 0 and 59.

long Ticks

Gets the tick count for this EssentialsDateTime. The returned value is the number of 100-nanosecond intervals that have elapsed since 1/1/0001 12:00am.

TimeSpan TimeOfDay

Gets the time-of-day part of this EssentialsDateTime. The returned value is a TimeSpan that indicates the time elapsed since midnight.

int Year

Returns the year part of this EssentialsDateTime. The returned value is an integer between 1 and 9999.

long UnixTimestamp

Gets the UNIX timestamp (amount of seconds since the start of the Unix Epoch) for this EssentialsDateTime.

bool IsLeapYear

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

bool IsWeekend

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

bool IsWeekday

Gets whether the day of this EssentialsDateTime is a weekday.

int WeekNumber

Gets the week number the ISO8601 week of this EssentialsDateTime.

EssentialsDateWeek Week

Gets a reference to an instance of EssentialsDateWeek representing the ISO 8601 week of this EssentialsDateTime.

int DaysInMonth

Gets the amount of days in the month.

bool IsZero

Gets whether the Unix timestamp of this EssentialsDateTime is 0.

bool IsNegative

Gets whether the Unix timestamp of this EssentialsDateTime is less than 0.

bool IsPositive

Gets whether the Unix timestamp of this EssentialsDateTime is greater than 0.

String Iso8601

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

String ToIso8601

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

String Rfc822

Gets a string representation of the instance as specified by the RFC 822 format.

String Rfc2822

Gets a string representation of the instance as specified by the RFC 2822 format.

String ToRfc2822

Gets a string representation of the instance as specified by the RFC 2822 format.

Methods

Returns a new EssentialsDateTime that adds the value of the specified TimeSpan to the value of this instance.

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

Returns a new EssentialsDateTime that adds the specified number of hours to the value of this instance.

Returns a new EssentialsDateTime that adds the specified number of milliseconds to the value of this instance.

Returns a new EssentialsDateTime that adds the specified number of minutes to the value of this instance.

Returns a new EssentialsDateTime that adds the specified number of months to the value of this instance.

Returns a new EssentialsDateTime that adds the specified number of seconds to the value of this instance.

Returns a new EssentialsDateTime that adds the specified number of ticks to the value of this instance.

Returns a new EssentialsDateTime that adds the specified number of years to the value of this instance.

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

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

CompareTo(object) (virtual)

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

Equals(object) (virtual)

Gets whether this EssentialsDateTime equals the specified obj.

Convert the specified ISO 8601 string to an instance of EssentialsDateTime.

Gets an instance of EssentialsDateTime representing the start of the specified ISO 8601week.

Convert the specified RFC 2822 string to an instance of EssentialsDateTime.

Convert the specified RFC 822 string to an instance of EssentialsDateTime.

Initialize a new instance from the specified UNIX timestamp.

Initialize a new instance from the specified UNIX timestamp.

Initialize a new instance from the specified UNIX timestamp.

Converts the value of this instance to all the string representations supported by the standard date and time format specifiers.

Converts the value of this instance to all the string representations supported by the standard date and time format specifiers and the specified culture-specific formatting information.

Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier.

Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier and culture-specific formatting information.

Gets the English name of the day.

Gets the first day of the month based on this EssentialsDateTime.

Gets the first day of the week based on this EssentialsDateTime. Monday is considered the first day of the week.

Gets the first day of the week based on this EssentialsDateTime and startOfWeek.

GetHashCode() (virtual)

Gets the hash code for this EssentialsDateTime.

Gets the last day of the month based on this EssentialsDateTime.

Gets the last day of the week based on this EssentialsDateTime. Monday is considered the first day of the week.

Gets the last day of the week based on this EssentialsDateTime and startOfWeek.

Gets the last day of the week based on this EssentialsDateTime and startOfWeek.

Gets the name of the day according to System.Globalization.CultureInfo.CurrentCulture.

Gets the name of the day according to culture.

Gets the name of the month according to current culture.

Gets the name of the month according to current culture.

Gets the name of the month according to culture.

Gets the English name of the month.

Indicates whether the internal instance of EssentialsDateTime is within the daylight saving time range for the current time zone.

Adds date and timespan.

Gets whether the timestamps represented by two instances of EssentialsDateTime are equal.

Gets whether d1 is greater than d2.

Gets whether d1 is greater than or equal to d2.

HEST Initializes a new instance of EssentialsDateTime from the specified timestamp.

Initializes a new instance of EssentialsDateTime from the specified timestamp.

Initializes a new instance of EssentialsDateTime from the specified timestamp.

Gets whether the timestamps represented by two instances of EssentialsDateTime are different from each other.

Gets whether d1 is less than d2.

Gets whether d1 is less than or equal to d2.

Subtracts timespan from date.

Subtracts two instances of EssentialsDateTime.

Parse(string) (static)

Parses the specified string into an instance of EssentialsDateTime.

Subtracts the specified date and time from this instance.

Subtracts the specified date and time from this instance.

Subtracts the specified duration from this instance.

Serializes the internal DateTime object to a 64-bit binary value that subsequently can be used to recreate the DateTime object.

Converts the value of the internal DateTime object to a Windows file time.

Converts the value of the internal DateTime object to a Windows file time.

Converts the value of the internal DateTime object to local time.

Converts the value of the internal DateTime object to its equivalent long date string representation.

Converts the value of the internal DateTime object to its equivalent long time string representation.

Converts the value of the internal DateTime object to the equivalent OLE Automation date.

Converts the value of the internal DateTime object to its equivalent short date string representation.

Converts the value of the internal DateTime object to its equivalent short time string representation.

ToString() (virtual)

Converts the value of the current EssentialsDateTime to its equivalent string representation.

Converts the value of the current EssentialsDateTime to its equivalent string representation using the specified provider.

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

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

Converts the value of the internal DateTime object to Coordinated Universal Time (UTC).

Converts the specified string representation of a date and time to its EssentialsDateTime equivalent and returns a value that indicates whether the conversion succeeded.

Converts the specified string representation of a date and time to its EssentialsDateTime equivalent using the specified culture-specific format information and formatting style, and returns a value that indicates whether the conversion succeeded.