getTimeSpanByNow

open fun getTimeSpanByNow(time: String, unit: Int): Long

Return the time span by now, in unit.

The pattern is {@code yyyy-MM-dd HH:mm:ss}.

Return

the time span by now, in unit

Parameters

time

The formatted time string.

unit

The unit of time span.

open fun getTimeSpanByNow(time: String, format: DateFormat, unit: Int): Long

Return the time span by now, in unit.

Return

the time span by now, in unit

Parameters

time

The formatted time string.

format

The format.

unit

The unit of time span.

open fun getTimeSpanByNow(date: Date, unit: Int): Long

Return the time span by now, in unit.

Return

the time span by now, in unit

Parameters

date

The date.

unit

The unit of time span.

open fun getTimeSpanByNow(millis: Long, unit: Int): Long

Return the time span by now, in unit.

Return

the time span by now, in unit

Parameters

millis

The milliseconds.

unit

The unit of time span.