如何施放此日期和保存到数据库 [英] How to cast this date and save to database
问题描述
8时15分16秒2010年4月1日PDT
我要保存这为DateTime在MSSQL数据库,但我不能转换在C#。有人可以帮我投了吗?而到底是什么 PDT
08:15:16 April 1, 2010 PDT
I need to save this to DateTime in MSSQL database but I can't convert this in C#. Can somebody help me to cast it? And what the hell is 'PDT
'?
推荐答案
这职位是与<一个href=\"http://stackoverflow.com/questions/241789/parse-datetime-with-timezone-of-form-pst-cest-utc-etc\">Parse日期时间与形式PST / CEST / UTC的时区的/ etc
我不知道如何从阿尔法时区得到的数字,但你做到这一点后,你可以
I'm not sure how to get from alpha timezone to numeric, but after you do that you can
DateTime myDate = Convert.ToDateTime("Thu, 18 Mar 2004 14:52:56-07:00");
更新:此链接显然包含code做了PDT,以GMT偏移量转换。 的http://字节.COM /主题/升C /答案/ 214648-怎么办-I-解析最新-W-时区还检查了的TimeZoneInfo类的 http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx
Update: This link apparently contains code to do the "PDT" to GMT offset conversion. http://bytes.com/topic/c-sharp/answers/214648-how-do-i-parse-date-w-time-zone Also check out the TimeZoneInfo class http://msdn.microsoft.com/en-us/library/system.timezoneinfo.aspx
这篇关于如何施放此日期和保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!