Gregorian class

Gregorian date class

Implemented types


Gregorian(int year, [int month = 1, int day = 1])
Create a Gregorian date by using year, month and day year and month default to 1 year, month and day can not be null [...]
Gregorian.fromDateTime(DateTime dateTime)
Create a Gregorian date by using DateTime object [...]
Gregorian.fromJalali(Jalali date)
Create a Gregorian date from Jalali date [...]
Gregorian.fromJulianDayNumber(int julianDayNumber)
Calculates Gregorian and Julian calendar dates from the Julian Day number julianDayNumber for the period since jdn=-34839655 (i.e. the year -100100 of both calendars) to some millions years ahead of the present. [...]
Get Gregorian date for now [...]


day int
Gregorian day of the month (1 to 28/29/30/31) [...]
formatter GregorianFormatter
Formatter for this date object [...]
read-only, override
hashCode int
hashcode operator [...]
read-only, override
julianDayNumber int
Calculates the Julian Day number from Gregorian or Julian calendar dates. This integer number corresponds to the noon of the date (i.e. 12 hours of Universal Time). [...]
read-only, override
month int
Gregorian month (1 to 12) [...]
monthLength int
Computes number of days in a given month in a Gregorian year. [...]
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
weekDay int
Week day number monday = 1 sunday = 7 [...]
read-only, override
year int
Gregorian year (years BC numbered 0, -1, -2, ...) [...]


add({int years: 0, int months: 0, int days: 0}) Gregorian
add days, months and years separately note: it does not make any conversion, it simply adds to each field value for subtracting simple add negative value [...]
addDays(int days) Gregorian
add days to this date this Method is safe [...]
addMonths(int months) Gregorian
add months to this date this Method is safe for month and year bounds [...]
addYears(int years) Gregorian
add years to this date [...]
compareTo(Gregorian other) int
Compare dates [...]
copy({int year, int month, int day}) Gregorian
Copy this date object with some fields changed [...]
isLeapYear() bool
Checks if a year is a leap year or not. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDateTime() DateTime
Converts Gregorian date to DateTime object [...]
toJalali() Jalali
Converts a Gregorian date to Jalali. [...]
toString() String
Default string representation: Gregorian(YYYY,MM,DD). use formatter for custom formatting. [...]
withDay(int day) Gregorian
changes day [...]
withMonth(int month) Gregorian
changes month [...]
withYear(int year) Gregorian
changes year [...]


operator +(int days) Gregorian
add days this Method is safe [...]
operator -(int days) Gregorian
subtract days this Method is safe [...]
operator <(Gregorian other) bool
less than operator [...]
operator <=(Gregorian other) bool
less than or equal operator [...]
operator ==(Object other) bool
equals operator [...]
operator >(Gregorian other) bool
bigger than operator [...]
operator >=(Gregorian other) bool
bigger than or equal operator [...]

Static Properties

MAX Gregorian
Maximum computable Gregorian date [...]
MIN Gregorian
Minimum computable Gregorian date [...]