解析一个*假设* Unix日期时间(带时区信息)到DateTime对象 [英] Parsing a *supposed* Unix date time (with timezone info) to DateTime object

查看:134
本文介绍了解析一个*假设* Unix日期时间(带时区信息)到DateTime对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


/ Date( 1391741913713 + 1100)/


有什么办法可以解析为 DateTime 对象?

我不相信这是一个真正的Unix dateTime对象...



看看这个接受的答案问题:如何将UNIX时间戳转换为DateTime,反之亦然?
解析方法需要一个double ...我的字符串包含+1100(以及outder / Date()/ part)

解决方案

正因为如此,当使用JSON.net解析JSON时,会自动处理


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 UNIX timestamp to DateTime and vice versa? The parsing method takes a double... my string contains +1100 (as well as the outder /Date()/ part)

解决方案

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

这篇关于解析一个*假设* Unix日期时间(带时区信息)到DateTime对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆