RichUtils / pyxis.uzuki.live.richutilskt.utils / kotlin.Long

Extensions for kotlin.Long

asDateString

fun Long.asDateString(format: String? = "yyyy-MM-dd HH:mm:ss"): String

get readable string of given timestamp.

convertToRelativeTime

fun Long.convertToRelativeTime(context: Context): String

convert time (in millis) into Relative Time

makeLimit

fun Long.makeLimit(min: Long = 0, max: Long = 0): Long

Adjust the given number so that it does not go out of range with given min, max

normalizeDate

fun Long.normalizeDate(timeZone: String = "UTC"): Long

normalize the date to the beginning of the day with given timeZone it equals to Time.getJulianDay()

toNumInUnits

fun Long.toNumInUnits(): String

Calcuate size into human-readable size