Hi, I use below logic to parse exchange time SALTIM_MS / QUOTIM_MS:
var time_ms = java.lang.Long.parseLong(str)
val nsec: Long = (time_ms % 1000)*1000000
val seconds: Long = time_ms / 1000 % 60
val minutes: Long = time_ms / 60000 % 60
val hours: Long = time_ms / 3600000 % 24
time = LocalTime.of(hours.intValue(), minutes.intValue(), seconds.intValue(), nsec.intValue())
But sometime there are value like this and have problem as value exceed long range:
java.lang.NumberFormatException: For input string: "18446744064486179580"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) ~[?:?]
at java.lang.Long.parseLong(Long.java:711) ~[?:?]
at java.lang.Long.parseLong(Long.java:836) ~[?:?]
What is the correct way to parse long value?