DateTime.ParseExact,忽略时区 [英] DateTime.ParseExact, Ignore the timezone

查看:691
本文介绍了DateTime.ParseExact,忽略时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个日期,例如 2011-05-05T11:35:47.743-04:00



我怎么能忽略时区?(-04:00)当我做了DateTime.ParseExact编程


解决方案

 的DateTimeOffset DT = DateTimeOffset.Parse(2011-05-05T11:35:47.743-04:00,NULL); 


If I have a date such as 2011-05-05T11:35:47.743-04:00

How can I ignore the timezone (-04:00) when I do a DateTime.ParseExact programatically?

解决方案

DateTimeOffset dt =DateTimeOffset.Parse("2011-05-05T11:35:47.743-04:00", null);

这篇关于DateTime.ParseExact,忽略时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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