DateTimeExten extension
- on
Methods
-
kaddMonth(
int month) → DateTime -
Available on DateTime, provided by the DateTimeExten extension
添加月 -
kcopy(
{int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) → DateTime -
Available on DateTime, provided by the DateTimeExten extension
复制日期 可以指定修改某个时间 -
kformat(
{DateFormat dateFormat = DateFormat.def}) → String -
Available on DateTime, provided by the DateTimeExten extension
日期 format 转换格式 -
kformatF(
String format) → String -
Available on DateTime, provided by the DateTimeExten extension
日期 format 转换格式,自定义转换格式 -
kgetDateByDayOffset(
{int offset = 0}) → DateTime -
Available on DateTime, provided by the DateTimeExten extension
获取指定天数的日期,0=当前日期,1=当前日期后一天,-1=当前日期前一天 -
kgetDayOfYear(
) → int -
Available on DateTime, provided by the DateTimeExten extension
在今年的第几天 -
kgetEndDate(
{int offset = 0}) → DateTime -
Available on DateTime, provided by the DateTimeExten extension
获取某一天的结束时间 -
kgetEndDateMs(
{int offset = 0}) → int -
Available on DateTime, provided by the DateTimeExten extension
获取某一天的结束时间-毫秒 -
kgetStartDate(
{int offset = 0}) → DateTime -
Available on DateTime, provided by the DateTimeExten extension
获取某一天的开始时间 -
kgetStartDateMs(
{int offset = 0}) → int -
Available on DateTime, provided by the DateTimeExten extension
获取某一天的开始时间-毫秒 -
kgetWeekday(
{bool isChina = true}) → String -
Available on DateTime, provided by the DateTimeExten extension
获取dateTime是星期几 支持中英文 -
kisLeapYear(
) → bool -
Available on DateTime, provided by the DateTimeExten extension
是否是闰年 -
kisSameDay(
DateTime d2) → bool -
Available on DateTime, provided by the DateTimeExten extension
判断是否是同一天 -
kisSameMonth(
DateTime d2) → bool -
Available on DateTime, provided by the DateTimeExten extension
判断是否是同一月 -
kisSameYear(
DateTime d2) → bool -
Available on DateTime, provided by the DateTimeExten extension
判断是否是同一年 -
kisToday(
) → bool -
Available on DateTime, provided by the DateTimeExten extension
判断是否为今天 -
kisYesterday(
) → bool -
Available on DateTime, provided by the DateTimeExten extension
根据时间判断是否是昨天