EssentialsTime Class
| Namespace | Skybrud.Essentials.Time |
|---|---|
| Assembly | Skybrud.Essentials.dll |
| Visibility | Public |
| Interfaces |
IComparable , IComparable<T>, IComparable<T>
|
| Inheritance | Object |
Class wrapping an instance of DateTimeOffset (as an alternative to using Nullable<T>).
public class EssentialsTime : IComparable, IComparable<T>, IComparable<T> { }
Properties
| Type | Name | Summary |
|---|---|---|
| EssentialsTime | Now |
Gets a EssentialsTime object that is set to the current date and time on this computer, expressed as the local time. |
| EssentialsTime | Today |
Gets an instance of EssentialsTime representing the current date, according to the local time. |
| EssentialsTime | UtcNow |
Gets a EssentialsTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC). |
| EssentialsTime | MinValue |
Represents the earliest possible EssentialsTime value. |
| EssentialsTime | MaxValue |
Represents the greatest possible value of EssentialsTime. |
| EssentialsTime | Zero |
Gets an instance of EssentialsTime representing the start of the Unix Epoch (AKA |
| TimeZoneInfo | TimeZone |
Gets the time zone. |
| bool | HasTimeZone |
Gets whether this EssentialsTime has a reference to a specific time zone. |
| DateTimeOffset | DateTimeOffset |
Gets the wrapped EssentialsTime.DateTimeOffset. |
| int | Day |
Returns the day-of-month part of this EssentialsTime. The returned value is an integer between |
| DayOfWeek | DayOfWeek |
Returns the day-of-week part of this EssentialsTime. The returned value is an integer
between |
| int | DayOfYear |
Gets the day-of-year part of this EssentialsTime. The returned value is an integer between |
| int | YearAndDay |
Returns a numeric value representing both the year and date. |
| int | Hour |
Gets the hour part of this EssentialsTime. The returned value is an integer between
|
| int | Millisecond |
Gets the millisecond part of this EssentialsTime. The returned value is an integer between |
| int | Minute |
Gets the minute part of this EssentialsTime. The returned value is an integer between |
| int | Month |
Gets the month part of this EssentialsTime. The returned value is an integer between |
| int | Second |
Gets the second part of this EssentialsTime. The returned value is an integer between |
| long | Ticks |
Gets the tick count for this EssentialsTime. The returned value is the number of 100-nanosecond intervals that have elapsed since |
| TimeSpan | TimeOfDay |
Gets the time-of-day part of this EssentialsTime. The returned value is a TimeSpan that indicates the time elapsed since midnight. |
| int | Year |
Gets the year part of this EssentialsTime. The returned value is an integer between |
| long | UnixTimestamp |
Gets the UNIX timestamp (amount of seconds since the start of the Unix Epoch) for this EssentialsTime. |
| TimeSpan | Offset |
Gets the time's offset from Coordinated Universal Time (UTC). |
| bool | IsLeapYear |
Gets whether the year of this EssentialsTime is a leap year. |
| bool | IsWeekend |
Gets whether the day of this EssentialsTime is within a weekend. |
| bool | IsWeekday |
Gets whether the day of this EssentialsTime is a weekday. |
| int | WeekNumber |
Gets the week number the ISO 8601 week of this EssentialsTime. |
| int | DaysInMonth |
Gets the amount of days in the month. |
| String | DaySuffix |
Gets the English ordinal suffix of the day. |
| bool | IsZero |
Gets whether the Unix timestamp of this EssentialsTime is |
| bool | IsNegative |
Gets whether the Unix timestamp of this EssentialsTime is less than |
| bool | IsPositive |
Gets whether the Unix timestamp of this EssentialsTime is greater than |
| bool | IsToday |
Gets whether the date of this EssentialsTime matches the current day. |
| bool | IsTomorrow |
Gets whether the date of this EssentialsTime matches the day after the current day. |
| bool | IsYesterday |
Gets whether the date of this EssentialsTime matches the day before the current day. |
| String | Iso8601 |
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 | DayName |
Gets the English name of the day. |
| String | AbbreviatedDayName |
Gets the abbreviated English name of the day. |
| String | LocalDayName |
Gets the name of the day according to the current culture. |
| String | AbbreviatedLocalDayName |
Gets the abbreviated name of the day according to the current culture. |
| String | MonthName |
Gets the English name of the month. |
| String | AbbreviatedMonthName |
Gets the abbreviated English name of the month. |
| String | LocalMonthName |
Gets the name of the month according to the current culture. |
| String | AbbreviatedLocalMonthName |
Gets the abbreviated name of the month according to the current culture. |
Methods
|
Returns a new EssentialsTime that adds the value of the specified TimeSpan to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of days to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of hours to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of milliseconds to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of minutes to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of months to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of seconds to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of ticks to the value of this instance. |
|
Returns a new EssentialsTime that adds the specified number of years to the value of this instance. |
|
CompareTo(DateTimeOffset)
(virtual)
Compares the value of this instance to a specified DateTimeOffset value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTimeOffset value. |
|
CompareTo(EssentialsTime)
(virtual)
Compares the value of this instance to a specified EssentialsTime value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified EssentialsTime value. |
|
CompareTo(object)
(virtual)
Compares the value of this instance to a specified object that contains a specified DateTimeOffset value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTimeOffset value. |
|
Equals(object)
(virtual)
Gets whether this EssentialsTime equals the specified |
|
FromIso8601(string)
(static)
Convert the specified ISO 8601 string to an instance of EssentialsTime. |
|
FromIso8601Week(int, int)
(static)
Gets an instance of EssentialsTime representing the start of the specified ISO 8601 |
|
FromIso8601Week(int, int, TimeSpan)
(static)
Gets an instance of EssentialsTime representing the start of the specified ISO 8601 |
|
Gets an instance of EssentialsTime representing the start of the specified ISO 8601 |
|
FromRfc2822(string)
(static)
Convert the specified RFC 2822 string to an instance of EssentialsTime. |
|
FromRfc822(string)
(static)
Convert the specified RFC 822 string to an instance of EssentialsTime. |
|
Converts the specified |
|
Converts the specified |
|
Converts the specified |
|
Converts the specified |
|
FromTicks(long)
(static)
Creates a new EssentialsTime instance from the specified amount of |
|
FromTicks(long, TimeSpan)
(static)
Creates a new EssentialsTime instance from the specified amount of |
|
FromUnixTimestamp(int)
(static)
Initialize a new instance from the specified UNIX timestamp. |
|
FromUnixTimestamp(long)
(static)
Initialize a new instance from the specified UNIX timestamp. |
|
FromUnixTimestamp(double)
(static)
Initialize a new instance from the specified UNIX timestamp. |
|
Gets a new instance of EssentialsTime representing the end of the day. |
|
Gets a new instance of EssentialsTime representing the end of the day. The end of the day will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the end of the month. |
|
Gets a new instance of EssentialsTime representing the end of the month. The end of the month will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the end of the week. |
|
Gets a new instance of EssentialsTime representing the end of the week. The end of the week will be adjusted according to the time zone and daylight saving. |
|
GetHashCode()
(virtual)
Gets the hash code for this EssentialsTime. |
|
Gets a new instance of EssentialsTime representing the start of the day. If EssentialsTime.TimeZone is present, the start of the day will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the start of the day. The start of the day will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the start of the month. If EssentialsTime.TimeZone is present, the start of the month will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the start of the month. The start of the month will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the start of the week. If EssentialsTime.TimeZone is present, the start of the week will be adjusted according to the time zone and daylight saving. |
|
Gets a new instance of EssentialsTime representing the start of the week. The start of the week will be adjusted according to the time zone and daylight saving. |
|
Adds |
|
Gets whether the timestamps represented by two instances of EssentialsTime are equal. |
|
Gets whether |
|
Gets whether |
|
op_Implicit(DateTime)
(static)
Initializes a new instance of EssentialsTime from the specified |
|
op_Implicit(DateTimeOffset)
(static)
Initializes a new instance of EssentialsTime from the specified
|
|
op_Implicit(long)
(static)
Initializes a new instance of EssentialsDateTime from the specified
|
|
op_Implicit(double)
(static)
Initializes a new instance of EssentialsTime from the specified
|
|
Gets whether the timestamps represented by two instances of EssentialsTime are different from each other. |
|
Gets whether |
|
Gets whether |
|
Subtracts |
|
Subtracts two instances of EssentialsTime. |
|
Parse(string)
(static)
Parses the specified string into an instance of EssentialsTime. |
|
Parse(string, IFormatProvider)
(static)
Parses the specified string into an instance of EssentialsTime. |
|
Parses the specified string into an instance of EssentialsTime. |
|
Subtracts the specified date and time from this instance. |
|
Subtracts the specified date and time from this instance. |
|
Converts the current EssentialsTime to another instance of EssentialsTime that represents the local time. |
|
Converts the value of the current EssentialsTime object to the date and time specified by an offset value. |
|
ToString()
(virtual)
Converts the value of the current EssentialsTime to its equivalent string representation. |
|
Converts the value of the current EssentialsTime to its equivalent string representation using the specified |
|
Converts the value of the current EssentialsTime to its equivalent string representation using the specified |
|
Converts the value of the current EssentialsTime to its equivalent string representation using the specified |
|
Converts the value of the current EssentialsTime to the corresponding date according to the specified |
|
Converts the current EssentialsTime to another instance of EssentialsTime that represents the Coordinated Universal Time (UTC). |
|
TryParse(string, out EssentialsTime)
(static)
Converts the specified string representation of a date and time to its EssentialsTime equivalent and returns a value that indicates whether the conversion succeeded. |
|
Tries to convert a specified string representation of a date and time to its EssentialsTime equivalent, and returns a value that indicates whether the conversion succeeded. |
|
Converts the specified |
|
Converts the specified |
|
Converts the specified |