Click or drag to resize

Date Structure

Represents a date with efficient operations.
Inheritance Hierarchy
SystemObject
  SystemValueType
    Austra.Library.DatesDate

Namespace: Austra.Library.Dates
Assembly: Austra.Library (in Austra.Library.dll) Version: 2.7.0+b25929339ea1019e260029cf0ebd18b3a0ce2443
Syntax
C#
public readonly struct Date : IEquatable<Date>, 
	IComparable<Date>, IEqualityOperators<Date, Date, bool>, 
	IComparisonOperators<Date, Date, bool>, IAdditionOperators<Date, int, Date>, 
	ISubtractionOperators<Date, int, Date>, ISubtractionOperators<Date, Date, int>, 
	IIncrementOperators<Date>, IDecrementOperators<Date>, ISpanParsable<Date>, 
	IParsable<Date>, IFormattable

The Date type exposes the following members.

Constructors
 NameDescription
Public methodDate(UInt32)Creates a Date from a day offset.
Public methodDate(Int32, Int32, Int32)Creates a Date instance given its three components.
Top
Properties
 NameDescription
Public propertyDayGets the day component from the date.
Public propertyDayOfWeekGets the day of week, being 0 the code for a Sunday.
Public propertyMonthGets the month component from the date.
Public propertyStatic memberTodayGets the current date.
Public propertyToIntGets the number of days since Jan 1st, 1, as an signed integer.
Public propertyYearGets the year component from the date.
Public propertyStatic memberZeroGets the zero date.
Top
Methods
 NameDescription
Public methodAddMonths(Int32)Adds a number of months to this date.
Public methodStatic memberAddMonths(Int32, Int32, Int32, Int32)Adds a number of months to a given date.
Public methodAddYearsAdds a number of years to this date.
Public methodCompareToCompares the current date with another.
Public methodStatic memberDaysInMonthReturns the number of days in the month given by a year and month.
Public methodDeconstruct(Int32, Int32)Extracts the year and month in a single call.
Public methodDeconstruct(Int32, Int32, Int32)Extracts all components from a date in a single call.
Public methodEquals(Date)Compares this date to another date.
Public methodEquals(Object)Compares this date to another object for equality.
(Overrides ValueTypeEquals(Object))
Public methodStatic memberFromYearCreates a Date instance for Jan 1st of the given year.
Public methodGetHashCodeReturns a hash code for this date.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsLeapChecks if the date belongs to a leap year.
Public methodStatic memberIsLeapYearChecks if a given year is a leap year.
Public methodStatic memberMaxGets the maximum of two dates.
Public methodStatic memberMinGets the minimum of two dates.
Public methodStatic memberParse(ReadOnlySpanChar, IFormatProvider)Parses a span of characters into a value.
Public methodStatic memberParse(String, IFormatProvider)Parses a string into a value.
Public methodRollEOMRolls this date up to the end of month.
Public methodRollIMMRolls this date up to the third Wednesday of the month.
Public methodToStringGets a textual representation of this date.
(Overrides ValueTypeToString)
Public methodToString(String, IFormatProvider)Gets a textual representation of this date.
Public methodTruncateDayChange the day of a date to the first day in the month.
Public methodStatic memberTryParse(ReadOnlySpanChar, IFormatProvider, Date)Tries to parse a span of characters into a value.
Public methodStatic memberTryParse(String, IFormatProvider, Date)Tries to parse a string into a value.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Date, Int32)Adds a number of days to a date.
Public operatorStatic memberDecrement(Date)Decrements a date by a day.
Public operatorStatic memberEquality(Date, Date)Compares two dates for equality.
Public operatorStatic member(Date to DateOnly)Converts a date into a standard date-only struct.
Public operatorStatic member(Date to DateTime)Converts a date into a date and time.
Public operatorStatic member(Date to UInt32)Converts a date to an unsigned integer.
Public operatorStatic member(DateTime to Date)Converts a date and time into a date.
Public operatorStatic memberGreaterThan(Date, Date)Checks if the first date comes later the second.
Public operatorStatic memberGreaterThanOrEqual(Date, Date)Checks if the first date is equal or comes before the second.
Public operatorStatic memberIncrement(Date)Increments a date by a day.
Public operatorStatic memberInequality(Date, Date)Compares two dates for inequality.
Public operatorStatic memberLessThan(Date, Date)Checks if the first date comes before the second.
Public operatorStatic memberLessThanOrEqual(Date, Date)Checks if the first date is equal comes before the second.
Public operatorStatic memberSubtraction(Date, Date)Gets the number of days between two dates.
Public operatorStatic memberSubtraction(Date, Int32)Subtracts a number of days from a date.
Top
Fields
 NameDescription
Public fieldStatic memberTicksPerDayNumber of 100ns ticks per day.
Top
See Also