Struct Date
Data structure that represents a date (year, month, day).
Implements
Inherited Members
Namespace: Unity.AppUI.Core
Assembly: Unity.AppUI.dll
Syntax
[Serializable]
public struct Date : IEquatable<Date>
Constructors
Date(DateTime)
Declaration
public Date(DateTime dateTime)
Parameters
Date(int, int, int)
Constructs a Date from a year, month and day.
Declaration
public Date(int year, int month, int day)
Parameters
Exceptions
Type | Condition |
---|---|
Argument |
Thrown if the year, month or day is out of range. |
Argument |
Thrown if the day is out of range for the given year and month. |
Properties
day
The date day.
Declaration
public int day { get; }
Property Value
Type | Description |
---|---|
int |
month
The date month.
Declaration
public int month { get; }
Property Value
Type | Description |
---|---|
int |
now
The current date.
Declaration
public static Date now { get; }
Property Value
Type | Description |
---|---|
Date |
year
The date year.
Declaration
public int year { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | Whether the specified object is equal to the current object. |
Overrides
Equals(Date)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(Date other)
Parameters
Type | Name | Description |
---|---|---|
Date | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | Whether the specified object is equal to the current object. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
ToString()
Returns a string that represents the current Date.
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(Date, Date)
Determines whether two Dates are equal.
Declaration
public static bool operator ==(Date left, Date right)
Parameters
Returns
operator >(Date, Date)
Declaration
public static bool operator >(Date left, Date right)
Parameters
Returns
operator >=(Date, Date)
Declaration
public static bool operator >=(Date left, Date right)
Parameters
Returns
implicit operator DateTime(Date)
Declaration
public static implicit operator DateTime(Date date)
Parameters
Returns
operator !=(Date, Date)
Determines whether two Dates are not equal.
Declaration
public static bool operator !=(Date left, Date right)
Parameters
Returns
operator <(Date, Date)
Declaration
public static bool operator <(Date left, Date right)
Parameters
Returns
operator <=(Date, Date)
Declaration
public static bool operator <=(Date left, Date right)