My client is sending me Long
which could be thought as
scala> System.currentTimeMillis
res3: Long = 1441056836609
scala>
How do I convert that into UTC
timeStamp?
On Server, we are using Java 8
You can use the Instant
class methods.
import java.time.Instant;
import java.time.ZoneOffset;
Instant.ofEpochMilli(<yourmillis>).atOffset(ZoneOffset.UTC).toString();
Your example date would be "2015-08-31T21:33:56.609Z"
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With