Class LocalDate
A date without a time-zone in the ISO-8601 calendar system.
LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day.
This class is implemented to match the Date representation CQL string literals.
Assembly: Cassandra.dll
Syntax
public class LocalDate : IComparable<LocalDate>, IEquatable<LocalDate>
Constructors
LocalDate(int, int, int)
Creates a new instance of LocalDate
Declaration
public LocalDate(int year, int month, int day)
Parameters
Type |
Name |
Description |
int |
year |
Year according to ISO-8601. Year 0 represents 1 BC.
|
int |
month |
The month number from 1 to 12
|
int |
day |
A day of the month from 1 to 31.
|
Properties
Day
Declaration
public int Day { get; set; }
Property Value
Month
Declaration
public int Month { get; set; }
Property Value
Year
Declaration
public int Year { get; set; }
Property Value
Methods
CompareTo(LocalDate)
Compares this instance value to another and returns an indication of their relative values.
Declaration
public int CompareTo(LocalDate other)
Parameters
Returns
DaysSinceJan1(int, int, int)
Returns the amount of days since Jan 1, for a given month/day
Declaration
public static int DaysSinceJan1(int year, int month, int day)
Parameters
Type |
Name |
Description |
int |
year |
|
int |
month |
|
int |
day |
|
Returns
Equals(LocalDate)
Determines if the value is equal to this instance.
Declaration
public bool Equals(LocalDate other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Parse(string)
Creates a new instance of LocalDate using the year, month and day provided in the form:
yyyy-mm-dd or days since epoch (i.e. -1 for Dec 31, 1969).
Declaration
public static LocalDate Parse(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
Returns
ToDateTimeOffset()
Returns the DateTimeOffset representation of the LocalDate for dates between 0001-01-01 and 9999-12-31
Declaration
public DateTimeOffset ToDateTimeOffset()
Returns
ToString()
Returns the string representation of the LocalDate in yyyy-MM-dd format
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(LocalDate, LocalDate)
Declaration
public static bool operator ==(LocalDate value1, LocalDate value2)
Parameters
Returns
operator >(LocalDate, LocalDate)
Declaration
public static bool operator >(LocalDate value1, LocalDate value2)
Parameters
Returns
operator >=(LocalDate, LocalDate)
Declaration
public static bool operator >=(LocalDate value1, LocalDate value2)
Parameters
Returns
operator !=(LocalDate, LocalDate)
Declaration
public static bool operator !=(LocalDate value1, LocalDate value2)
Parameters
Returns
operator <(LocalDate, LocalDate)
Declaration
public static bool operator <(LocalDate value1, LocalDate value2)
Parameters
Returns
operator <=(LocalDate, LocalDate)
Declaration
public static bool operator <=(LocalDate value1, LocalDate value2)
Parameters
Returns
Implements