get Fit Time Span By Now
Return the fit time span by now.
The pattern is {@code yyyy-MM-dd HH:mm:ss}
.
Return
the fit time span by now
Parameters
time
The formatted time string.
precision
The precision of time span.
- precision = 0,返回 null
- precision= 1,返回天
- precision = 2,返回天和小时
- precision = 3,返回天、小时和分钟
- precision =4,返回天、小时、分钟和秒
- precision >= 5,返回天、小时、分钟、秒和毫秒
open fun getFitTimeSpanByNow(time: String, format: DateFormat, precision: Int): String
Content copied to clipboard
Return the fit time span by now.
Return
the fit time span by now
Parameters
time
The formatted time string.
format
The format.
precision
The precision of time span.
- precision = 0,返回 null
- precision= 1,返回天
- precision = 2,返回天和小时
- precision = 3,返回天、小时和分钟
- precision =4,返回天、小时、分钟和秒
- precision >= 5,返回天、小时、分钟、秒和毫秒
Return the fit time span by now.
Return
the fit time span by now
Parameters
date
The date.
precision
The precision of time span.
- precision = 0,返回 null
- precision= 1,返回天
- precision = 2,返回天和小时
- precision = 3,返回天、小时和分钟
- precision =4,返回天、小时、分钟和秒
- precision >= 5,返回天、小时、分钟、秒和毫秒
Return the fit time span by now.
Return
the fit time span by now
Parameters
millis
The milliseconds.
precision
The precision of time span.
- precision = 0,返回 null
- precision= 1,返回天
- precision = 2,返回天和小时
- precision = 3,返回天、小时和分钟
- precision =4,返回天、小时、分钟和秒
- precision >= 5,返回天、小时、分钟、秒和毫秒