如何施放此日期和保存到数据库 [英] How to cast this date and save to database

查看:137
本文介绍了如何施放此日期和保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

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