DateTime GetTime(double timeStamp) { DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); timeStamp = timeStamp * 10000; long lTime = Convert.ToInt64(timeStamp); // long lTime = long.Parse(Convert.ToInt64(timeStamp)+"0000"); TimeSpan toNow = new TimeSpan(lTime); return dtStart.Add(toNow); }
MessageBox.Show(GetTime(1508381207810.627).ToString("yyyy-MM-dd HH:mm:ss fff") + "");
<script type="text/javascript">
window.onload = function () {
var t1 = 1508381207810.627;
var dt = new Date(t1);
alert(Date.parse(dt));