https://kotlinlang.org logo
#announcements
Title
# announcements
a

alvico

04/19/2018, 4:23 PM
Copy code
val millis: Long = calendar.get(Calendar.HOUR_OF_DAY).toLong() * 60 * 60 * 1000
        .plus(calendar.get(Calendar.MINUTE).toLong() * 60 * 1000)
        .plus(calendar.get(Calendar.SECOND).toLong() * 1000)
        .plus(calendar.get(Calendar.MILLISECOND).toLong())

 val millis2: Long = calendar.get(Calendar.HOUR_OF_DAY).toLong() * 60 * 60 * 1000 +
        calendar.get(Calendar.MINUTE).toLong() * 60 * 1000 +
        calendar.get(Calendar.SECOND).toLong() * 1000 +
        calendar.get(Calendar.MILLISECOND).toLong()

 Assert.assertEquals(millis, millis2)