DateTimeExtension extension
时间相关
- on
Properties
- dayIndexOfYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
处在当年的第几天no setter - daysOfYear → int
-
Available on DateTime, provided by the DateTimeExtension extension
当年的总天数no setter - firstDayInYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
当年最早的时间no setter - isLeapYearByYear → bool
-
Available on DateTime, provided by the DateTimeExtension extension
是否是闰年no setter - lastDayInYear → DateTime
-
Available on DateTime, provided by the DateTimeExtension extension
当年最后的时间no setter - timeZone → double
-
Available on DateTime, provided by the DateTimeExtension extension
获取时区no setter
Methods
-
copyWith(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
复制对象 -
dayIndexOfWeek(
[int firstWeekDay = 1]) → int -
Available on DateTime, provided by the DateTimeExtension extension
获取当前日期处在当前周的第几天 -
daysInMonth(
[int firstDay = 1]) → int -
Available on DateTime, provided by the DateTimeExtension extension
当月总天数 -
firstDayInMonth(
[int firstDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
当月第一天 -
firstDayInNextMonth(
[int firstDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
下月第一天 -
firstDayInNextWeek(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
下周第一天 -
firstDayInPreviousMonth(
[int firstDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
上月第一天 -
firstDayInPreviousWeek(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
上周第一天 -
firstDayInWeek(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
本周第一天 -
firstWeekFirstDayInYear(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
当年第一周的第一天。 算法:获取1月4号所在周的第一天 -
firstWeekLastDayInYear(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
当年第一周的最后一天。 算法:获取1月4号所在的周 -
getDateStr(
{String format = 'yyyy-MM-dd', MiniLocalType localType = MiniLocalType.zh}) → String -
Available on DateTime, provided by the DateTimeExtension extension
获取日期显示字符串 yyyy-MM-dd EEEE/EE -
getDateTimeStr(
{String format = 'yyyy-MM-dd HH:mm:ss', MiniLocalType localType = MiniLocalType.zh}) → String -
Available on DateTime, provided by the DateTimeExtension extension
获取时间字符串yyyy-MM-dd HH:mm:ss.SSS EEEE/EE
-
getFirstWeekdaysInYear(
[int firstWeekDay = 1]) → List< DateTime> -
Available on DateTime, provided by the DateTimeExtension extension
当年第一周所有日期 -
getTimeZone(
) → double -
Available on DateTime, provided by the DateTimeExtension extension
获取当前时间系统的本地时区 -
getWeekdays(
[int firstWeekDay = 1]) → List< DateTime> -
Available on DateTime, provided by the DateTimeExtension extension
本周所有日期 -
getWeekShortStr(
[MiniLocalType localType = MiniLocalType.zh]) → String -
Available on DateTime, provided by the DateTimeExtension extension
获取短星期 -
getWeekStr(
[MiniLocalType localType = MiniLocalType.zh]) → String -
Available on DateTime, provided by the DateTimeExtension extension
获取长日期 -
isToday(
[DateTime? now]) → bool -
Available on DateTime, provided by the DateTimeExtension extension
是否是今天now
- 当前时间,默认DateTime.now() -
isYesterday(
[DateTime? now]) → bool -
Available on DateTime, provided by the DateTimeExtension extension
是否是昨天now
- 当前时间,默认DateTime.now() -
lastDayInMonth(
[int firstDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
当月最后一天 -
lastDayInNextMonth(
[int firstDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
下月最后一天 -
lastDayInNextWeek(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
下周最后一天 -
lastDayInPreviousMonth(
[int firstDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
上月最后一天 -
lastDayInPreviousWeek(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
上周最后一天 -
lastDayInWeek(
[int firstWeekDay = 1]) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
本周最后一天 -
maxDate(
DateTime? other) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
获取最大时间 -
minDate(
DateTime? other) → DateTime -
Available on DateTime, provided by the DateTimeExtension extension
获取最小时间 -
weekIndexOfYear(
[int firstWeekDay = 1]) → int -
Available on DateTime, provided by the DateTimeExtension extension
获取当前时间是一年中的第几周
0-上一年的最后一周
-1-下一年的第一周
Operators
-
operator -(
DateTime other) → int -
Available on DateTime, provided by the DateTimeExtension extension
计算差值 -
operator <(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
比较时间 -
operator <=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
比较时间 -
operator >(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
比较时间 -
operator >=(
DateTime other) → bool -
Available on DateTime, provided by the DateTimeExtension extension
比较时间