How to convert telegraph API core date: int type to Java date?
•
Java
See English answers > converting long to date in Java returns 1970 11
There is date: int, a ten digit integer with a value of, for example, 1468782578 for today (Sunday, July 17, 2016). How to convert the telegraph API core date: int type to Java date? thank you.
Solution
I'm looking for a c# converter. I found Java below
public static DateTime JavaTimeStampToDateTime(double javaTimeStamp) { // Java timestamp is millisecods past epoch System.DateTime dtDateTime = new DateTime(1970,1,System.DateTimeKind.Utc); dtDateTime = dtDateTime.AddSeconds(Math.Round(javaTimeStamp / 1000)).ToLocalTime(); return dtDateTime; }
reference resources: https://stackoverflow.com/a/250400/1032109
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码