从服务器移出时的DateTime问题 [英] DateTime issue while moving from server
问题描述
Currenly我只使用c#在asp.net 3.5中进行了应用.完成的项目托管在服务器(位于印度的 服务器 )中,并且所有用户都可以正常使用它.
现在,其他团队也需要相同的应用程序.因此他们给了新服务器并要求我托管(位于美国的 服务器 ).但是当我托管和测试应用程序时,在转换日期时间时出现以下错误.
Hi,
Currenly i did only application in asp.net 3.5 with c#. completed project & hosted in server (Server located in INDIA) and all users using it without any issue.
Now the same application required for someother team. so they gave new server and ask me to host (Server located in USA). But while i hosted and testing application i get following error in convertion of datetime.
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
日期格式:mm/dd/yyyy hh:mmPM/AM
范例:2011年12月21日1:30 PM
希望它没有编码问题.如果是这样,则它必须在我托管在印度服务器本身中时出现.
请帮助我.
dateformat : mm/dd/yyyy hh:mmPM/AM
Example : 12/21/2011 1:30PM
Hope its not coding issue. if so it must appear while i host in INDIA server itself.
Please help me.
推荐答案
看看这个:
http://stackoverflow.com/questions/1509977/convert-varchar-into- datetime-in-sql-server [ ^ ]
希望对您有帮助
Hi,
Take a look at this:
http://stackoverflow.com/questions/1509977/convert-varchar-into-datetime-in-sql-server[^]
Hope it helps
可能与时区设置有关,
通过下面的链接,这将对您有帮助
此处 [
May be issue with the time zone settings,
go through the below link, this will help you
Here[^]
Thanks
--RA
hi all, i find an alternate solution.
my current query :
<pre>CONVERT(VARCHAR,BIS_RequestMaster.RequestDate,101) + ' ' + CONVERT(VARCHAR,BIS_RequestMaster.RequestTime,100) AS RequestDate</pre>
changed to :
<pre>CONVERT(DATETIME,(CONVERT(VARCHAR,BIS_RequestMaster.RequestDate,101) + ' ' + CONVERT(VARCHAR,BIS_RequestMaster.RequestTime,100)),101) AS RequestDate</pre>
i dont know whats this :( but want to change in all place of my code. is this the only solution :((
这篇关于从服务器移出时的DateTime问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!