public class TimeUtils extends Object
| Constructor and Description |
|---|
TimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.time.Instant |
getInstantFromSecondsOrMilliseconds(long time)
Parses a time that is not known to be in seconds or milliseconds.
|
public static java.time.Instant getInstantFromSecondsOrMilliseconds(long time)
Frustratingly enough, it seems that some of the APIs we deal with ...ahem TextLine... return their timestamps in seconds instead of milliseconds like everyone else does.
So we guess that it is in seconds, and if we find that our date is after the year 3000 we assume the date must be in milliseconds.
time - can be in milliseconds or seconds and we'll figure it out.Copyright © 2019. All rights reserved.