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

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