DateUtil class

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 Methods

daysBetweenDay(DateTime a, DateTime b) int
计算两个日期相差多少天
daysBetweenMillSecond(DateTime a, DateTime b) int
计算两个日期相差多少毫秒
daysBetweenMin(DateTime a, DateTime b) int
计算两个日期相差多少分钟
daysBetweenMonth(DateTime a, DateTime b) int
计算两个日期相差多少月
daysBetweenSecond(DateTime a, DateTime b) int
计算两个日期相差多少秒
daysBetweenYear(DateTime a, DateTime b) int
计算两个日期相差多少年
getCurMonth(DateTime date) List<String>
获取本月-截止当天
getDayBeforeYesterdayDayYYYYMMDD(DateTime dateTime) String
获取前天
getDayCounts(int month) int
获取一个月有多少天
getLastMonth(DateTime date) List<String>
获取上月
getLastWeek(DateTime date) List<String>
获取上周
getLastWeekFirstDayYYYYMMDD(DateTime dateTime) String
获取上周开始
getLastWeekLastDayYYYYMMDD(DateTime dateTime) String
获取上周结束
getMonthFirstDayYYYYMMDD(DateTime dateTime, String space) String
获取本月第一天
getMonthLastDayYYYYMMDD(DateTime dateTime, String space) String
获取本月最后一天
getNextMonth(DateTime date) List<String>
获取下月
getNextWeek(DateTime date) List<String>
获取下周
getThisMonth(DateTime date) List<String>
获取本月
getThisWeek(DateTime date) List<String>
获取本周
getTomorrowAcquiredYYYYMMDD(DateTime dateTime) String
获取后天
getTomorrowDayYYYYMMDD(DateTime dateTime) String
获取明天
getWeekday(DateTime? dateTime) String?
获取周几
getWeekFirstDayYYYYMMDD(DateTime dateTime) String
获取本周开始
getWeekLastDayYYYYMMDD(DateTime dateTime) String
获取本周结束
getYesterDayYYYYMMDD(DateTime dateTime) String
获取昨天
getYYYYMMDD(DateTime dateTime, String space) String
获取当天(不足两位,拼0处理)space 需要拼接日期的字段
getYYYYMMDDHHMMSS(DateTime dateTime, String space) String
获取当天(不足两位,拼0处理)* space 需要拼接日期的字段