Click or drag to resize
Date Class
The Date class is an immutable data type to encapsulate a date (day, month, and year).
Inheritance Hierarchy
SystemObject
  Algs4NetDate

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Date : IComparable<Date>

The Date type exposes the following members.

Constructors
  NameDescription
Public methodDate(String)
Initializes new date specified as a string in form MM/DD/YYYY.
Public methodDate(Int32, Int32, Int32)
Initializes a new date from the month, day, and year.
Top
Properties
  NameDescription
Public propertyDay
Returns the day.
Public propertyMonth
Return the month.
Public propertyYear
Returns the year.
Top
Methods
  NameDescription
Public methodCompareTo
Compares two dates chronologically.
Public methodEquals
Compares this date to the specified date.
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Returns an integer hash code for this date.
(Overrides ObjectGetHashCode.)
Public methodIsAfter
Compares two dates chronologically.
Public methodIsBefore
Compares two dates chronologically.
Public methodStatic memberMainTest
Demo test the Date data type.
Public methodNext
Returns the next date in the calendar.
Public methodToString
Returns a string representation of this date.
(Overrides ObjectToString.)
Top
Remarks

For additional documentation, see Section 1.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class Date implementation by the respective authors.

See Also