TimeUtils 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
Static Methods
-
calculateDateDiff(DateTime startDate, DateTime endDate)
→ int
-
-
convertToZHDateTimeString(String time, String? timeSeparate)
→ String
-
-
dateTimeSeparate(String time, String? dateSeparate, String? timeSeparate)
→ String
-
分隔符转换.
-
formatDateTime(String time, DateFormat format, String? dateSeparate, String? timeSeparate, bool? isZH)
→ String
-
-
getAge(DateTime brt)
→ String
-
-
getConstellation(DateTime birthday)
→ String
-
-
getDateTime({String? dateStr, int? milliseconds})
→ DateTime
-
将字符串或者时间戳转化成DateTime
-
getDayOfYear(DateTime dateTime)
→ int
-
在今年的第几天
-
getDurationFromHour(int sec)
→ String
-
持续时间(h)
-
getDurationFromMinutess(int minutes)
→ String
-
持续时间(m)
-
getNowTime(DateTime? date)
→ String?
-
获取时间,为空时为当前时间 (默认为yyyy-MM-dd HH:mm:ss)
-
getNowTimeStamp(DateTime? date)
→ int
-
获取时间戳,为空时为当前时间戳
-
getTime({DateTime? dateTime, int? milliseconds, DateFormat format = DateFormat.NORMAL, String? dateSeparate, String? timeSeparate, bool? isZh = false})
→ String?
-
DateTime或者时间戳转字符串
-
isLeapYearByYear(int year)
→ bool
-
是否为闰年
-
isToday(DateTime dateTime)
→ bool
-
是否为今天.
-
isYesterday(DateTime dateTime, DateTime locDateTime)
→ bool
-
是否是昨天.
-
yearAndMonthIsEqual(DateTime dateTime, DateTime locDateTime)
→ bool
-
是否同年同月
-
yearIsEqual(DateTime dateTime, DateTime locDateTime)
→ bool
-
是否同年