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

getDateFormatStr(dynamic date, {String split = '-', String splitTime = ':', bool onlyDate = true, bool onlyTime = false, bool hasMlis = false, String? formatter}) String
时间格式化-将DateTime、String类型的数据转换为需要格式的时间字符
getDateStr(dynamic date, {String split = '-'}) String
时间格式化-将DateTime、String类型的数据转换为需要格式的时间字符
getDaysInMonth(int year, int month) int
ref Flutter DateUtils.getDaysInMonth
getEndOfDay({DateTime? date}) DateTime
获取某一天的结束时间
getEndOfMonth({DateTime? date}) DateTime
获取某月最后一天的结束时间
getEndOfYear({DateTime? date}) DateTime
获取指定年份的最后一天的结束时间
getStartOfDay({DateTime? date}) DateTime
获取某一天的开始时间
getStartOfMonth({DateTime? date}) DateTime
获取某一月的开始时间
getStartOfYear({DateTime? date}) DateTime
获取指定年份的开始时间
getTimeStr(dynamic date, {String split = ':', bool? hasMlis}) String
时间格式化-获取 时、分、秒? 格式化后的数据
getWeekStr(dynamic date, {String prefix = '周'}) String
日期格式化-获取某一天的星期描述文字
getWeekStrByValue(int value, {String prefix = '周'}) String
tryParse(dynamic value) DateTime?
将各传入值解析为DateTime对象