hhac

Kotlin TimeStamp Milliseconds

Jul 27th, 2021
1,028
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Test
  2. fun testTime() {
  3.     // val timeInMs = Instant.parse("2021-07-26T18:18:57.359Z").toEpochMilliseconds()
  4.     val timeInMs = Instant.parse("2021-07-27T01:18:57.359Z").toEpochMilliseconds()
  5.     println(":::: time in ms $timeInMs")
  6.     println(":::: time in seconds ${timeInMs/1000}")
  7. }
RAW Paste Data