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
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
Since you are using scala, I would suggest you use the scala way, nscala-time is a very good library
That will get a Date object, which you can then spit out in a proper UTC format using
This is what I am doing
I am using Joda-Time and doing
On
client
I see it asand on
server
I see it asP.S. Don't compare values, they are copied differently, the format is what I wanted to share
You can use the
Instant
class methods.Your example date would be
"2015-08-31T21:33:56.609Z"
.