DateConstants class abstract final

Utility class providing static constants for commonly used date/time values.

This class cannot be instantiated. Access constants via DateConstants.xxx.

Example usage:

DateTime epoch = DateConstants.unixEpochDate;
bool valid = month >= DateConstants.minMonth;

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

unixEpochDate DateTime
January 1st, 1970 is known as the Unix epoch. It is the date and time that Unix systems use as the reference point for measuring time. This date was chosen arbitrarily by early Unix engineers because they needed a uniform and convenient date for the start of time.
final

Constants

coppaMinAge → const int
Minimum age for non-child content access under COPPA.
dayEndHour → const int
Hour threshold for end of "day" time (before 6pm/18:00).
daysInFebLeapYear → const int
Number of days in February during a leap year.
daysPerWeek → const int
Number of days in a week.
dayStartHour → const int
Hour threshold for start of "day" time (after 7am).
daysToAddToGetNextMonth → const int
Days to add to safely reach next month (28 + 4 = 32 days > any month).
decemberLastDay → const int
Last day of December.
defaultLeapYearCheckYear → const int
Default year to use for leap year calculations when year is not specified (chosen as a leap year).
isoWeekOffset → const int
Offset used in the ISO 8601 week number formula.
isoWeekReferenceDay → const int
December day used to determine ISO weeks in a year.
lastDayOffsetInWeek → const int
Days from start of week to end of week (0-based index of last weekday).
leapYearModulo4 → const int
Modulo divisor for basic leap year check (divisible by 4).
leapYearModulo100 → const int
Modulo divisor for century leap year exception (divisible by 100).
leapYearModulo400 → const int
Modulo divisor for century leap year exception override (divisible by 400).
maxHour → const int
Maximum valid hour (23 for 24-hour format, 0-23 range).
maxMillisecondOrMicrosecond → const int
Maximum valid millisecond or microsecond (999 for 0-999 range).
maxMinuteOrSecond → const int
Maximum valid minute or second (59 for 0-59 range).
maxMonth → const int
Maximum valid month number (December).
maxYear → const int
Maximum valid year in DateTime (9999).
minDaysInAnyMonth → const int
Minimum number of days that exist in any month (February in non-leap years).
minMonth → const int
Minimum valid month number (January).
minutesPerHour → const int
Number of minutes in one hour.
monthsPerQuarter → const int
Number of months per quarter.
yearStringWidth → const int
Number of digits in a year for zero-padded formatting.