0

我是一名 Android 开发人员,我在使用 .Net 时遇到问题“自 0001 年 1 月 1 日午夜 12:00:00(公历中 0001 年 1 月 1 日 0:00:00 UTC)以来”。

如何将 java getTimeInMillis() 转换为 .Net 时间值?预先感谢

4

1 回答 1

1
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //change your formate accordingly
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));

String inputString = "00:01:30.500";

Date date = sdf.parse("1970-01-01 " + inputString);
System.out.println("in milliseconds: " + date.getTime());  
于 2015-07-13T09:49:42.120 回答