Hi all, what is a good way to format a timestamp t...
# getting-started
l
Hi all, what is a good way to format a timestamp that's currently stored as millis Long as a date?
The accepted answer, in Kotlin:
Copy code
val d = Date(millis)
val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS")
val dateStr = sdf.format(d)
w
You can make an extension function for Long like:
Copy code
fun Long.toSimpleDT(): String {
    return DateTimeFormat.forPattern("M/dd h:mm:ss a")
            .withZone(DateTimeZone.forID("America/New_York"))
            .print(this * 1000)
}