Skip to main content
1

πŸ—“οΈ Simple Duration

DateTime
int
required
The number of days to add to the current date.
Adds a number of days to the current DateTime object.
DateTime
int
required
The number of days to subtract from the current date.
Subtracts a number of days from the current DateTime object.
2

πŸ“… Calendar Components (Use with Caution)

Be cautious with addMonths and addYears. Dart’s DateTime constructor handles invalid days (like Feb 30th) by overflowing to the next month/year. Always test edge cases (e.g., Jan 31st + 1 month = Mar 3rd).
DateTime
int
required
The number of months to add to the current date.
Adds a number of months. (Warning: Susceptible to date overflow errors.)
DateTime
int
required
The number of months to subtract from the current date.
Subtracts a number of months. (Warning: Susceptible to date overflow errors.)
DateTime
int
required
The number of years to add to the current date.
Adds a number of years. (Warning: Be mindful of leap years.)
DateTime
int
required
The number of years to subtract from the current date.
Subtracts a number of years. (Warning: Be mindful of leap years.)
3

πŸ’Ό Business Days

DateTime
int
required
The number of business days to add.
Adds a number of business days (Monday to Friday) to the current date, automatically skipping weekends.