LocalDate class

Represents a calendar date without any associated time or timezone.

Inheritance

Constructors

LocalDate(int year, [int month = 1, int day = 1])
LocalDate.fromDateTime(DateTime date)
Creates a new LocalDate from the year, month and day properties of the given DateTime.

Properties

day int
The day of the month [1..31].
no setter
hashCode int
The hash code for this object.
no setteroverride
month int
The month [1..12].
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weekday int
The day of the week DateTime.monday..DateTime.sunday.
no setter
year int
The year.
no setter

Methods

compareTo(LocalDate other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the date in the format YYYY-MM-DD.
override

Operators

operator ==(Object other) bool
Returns true if other is a LocalDate with the same date.
override

Static Methods

parse(String formattedString) LocalDate
Creates a new LocalDate from a formattedString.
tryParse(String formattedString) LocalDate?
Creates a new LocalDate from a formattedString, or null if the string is not a valid date.