Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 java {"UserCreationTime":"/Date(1348477516620+0530)/"}中解析 Json 日期这是我从 .net wcf 服务获得的 json 响应,它基本上是 C# 中的 DateType 类型。提前致谢。
第一个数字1348477516620是自 1970 年 1 月 1 日 UTC 以来的毫秒数。
1348477516620
第二个数字+0530是在此特定时间点创建此值的系统的 UTC 偏移量。但是该数字不会以任何方式反映在第一个值中。
+0530
换句话说,如果您只关心时间上的特定实例,请扔掉第二部分,只使用第一部分。
Date date = new Date(1348477516620);
是的,这是一种丑陋的格式,没有人喜欢它。它正逐渐被淘汰,取而代之的是 ISO8601。