getTimeSpan

open fun getTimeSpan(time1: String, time2: String, unit: Int): Long

Return the time span, in unit.

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

Return

the time span, in unit

Parameters

time1

The first formatted time string.

time2

The second formatted time string.

unit

The unit of time span.

open fun getTimeSpan(time1: String, time2: String, format: DateFormat, unit: Int): Long

Return the time span, in unit.

Return

the time span, in unit

Parameters

time1

The first formatted time string.

time2

The second formatted time string.

format

The format.

unit

The unit of time span.

open fun getTimeSpan(date1: Date, date2: Date, unit: Int): Long

Return the time span, in unit.

Return

the time span, in unit

Parameters

date1

The first date.

date2

The second date.

unit

The unit of time span.

open fun getTimeSpan(millis1: Long, millis2: Long, unit: Int): Long

Return the time span, in unit.

Return

the time span, in unit

Parameters

millis1

The first milliseconds.

millis2

The second milliseconds.

unit

The unit of time span.