ms_datetime_extensions library

Classes

Timezones
Timezones provides a shotcut way to set timezone for dateTimeFromInternet

Functions

copyWith(DateTime origin, {int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) DateTime
Return a new instance of DateTime with new values
dateTimeFromInternet({String? timezone, bool useHttps = false}) Future<DateTime>
Get current DateTime from internet timezone Set a timezone. Use Timezones useHttps If true use https instead of http to make request to the worldtimeapi.org if null will return a timezone from public client ip
isAtSameDay(DateTime dateTime, DateTime dateTimeToCompare) bool
Return true if dateTime and dateTimeToCompare happened on the same day
isAtSameHour(DateTime dateTime, DateTime dateTimeToCompare) bool
Return true if dateTime and dateTimeToCompare happened on the same hour
isAtSameMinute(DateTime dateTime, DateTime dateTimeToCompare) bool
Return true if dateTime and dateTimeToCompare happened on the same minute
isAtSameMonth(DateTime dateTime, DateTime dateTimeToCompare) bool
Return true if dateTime and dateTimeToCompare happened on the same month
isAtSameSecond(DateTime dateTime, DateTime dateTimeToCompare) bool
Return true if dateTime and dateTimeToCompare happened on the same second
isAtSameYear(DateTime dateTime, DateTime dateTimeToCompare) bool
Return true if dateTime and dateTimeToCompare happened on the same year
isAtToday(DateTime dateTime) bool
Return true if dateTime happened today
nextDayOfTheWeek(DateTime from, int weekday) DateTime
Return a new instance DateTime with next day of the week
nextWeekday(DateTime from, int weekday) DateTime
Deprecated, use nextDayOfTheWeek instead of nextWeekday.
previousDayOfTheWeek(DateTime from, int weekday) DateTime
Return a new instance DateTime with previous day of the week