Parsing a *supposed* Unix date time (with timezone info) to DateTime object

痞子三分冷 提交于 2019-12-12 03:41:20

问题


I have a supposed Unix date format coming through in a json feed from a third party that looks like this:

/Date(1391741913713+1100)/

Is there any way I can parse that to a DateTime object?
I'm not convinced this is a "true" Unix dateTime object...

Looking at the accepted answer to this question: How to convert a Unix timestamp to DateTime and vice versa? The parsing method takes a double... my string contains +1100 (as well as the outder /Date()/ part)


回答1:


As it happens, when parsing from JSON using JSON.net, this is handled automatically



来源:https://stackoverflow.com/questions/22211779/parsing-a-supposed-unix-date-time-with-timezone-info-to-datetime-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!