C# has Datetime.FromBinary(long)
method which accepts long
. I have long data = -8587633342590756227
.
Datetime.FromBinary(-8587633342590756227)
which gives {7/30/2015 10:10:26 AM}. How to convert it to date-time format in Java?
Thanks
C# has Datetime.FromBinary(long)
method which accepts long
. I have long data = -8587633342590756227
.
Datetime.FromBinary(-8587633342590756227)
which gives {7/30/2015 10:10:26 AM}. How to convert it to date-time format in Java?
Thanks
The value .Net (de-)serializes via To-/FromBinary
seems very specific to .Net, so I don't think there's an easy way to convert that value into a java.util.Date
.
The easiest way I can think of from the perspective of a Java developer would be to convert your .Net DateTime
to Unix time (see DateTimeOffset.ToUnixTimeMilliseconds) and then use that value for the java.util.Date
constructor that accepts that value.