Date class final

A gregorian calendar date

Implemented types
Annotations

Constructors

Date({required int year, int month = 1, int day = 1})
Creates a Date with the given year, month, and day.
const

Properties

day → int
The day of this date. First day is 1.
final
hashCode → int
The hash code for this object.
no setteroverride
month → int
The month of this date. January is 1.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
year → int
The year of this date.
final

Methods

add(Duration duration) → Date
Returns a new Date with the given duration added.
compareTo(Date other) → int
Compares this object to another object.
override
difference(Date other) → Duration
Returns the Duration between this date and other.
isAfter(Date other) → bool
Whether this date is after other.
isAtSameMomentAs(Date other) → bool
Whether this date is at the same moment as other.
isBefore(Date other) → bool
Whether this date is before other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subtract(Duration duration) → Date
Returns a new Date with the given duration subtracted.
toDateTime({bool utc = false}) → DateTime
Convert to a DateTime.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

now({bool utc = false}) → Date
The current date