在MS SQL Server数据库中设置时区 [英] Setting time Zone in MS SQL Server Database
本文介绍了在MS SQL Server数据库中设置时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在Windows Azure云存储上将php与mssql一起使用, 当我使用代码插入datetime时,它将插入
i am using php with mssql, on windows azure cloud storage , when i insert datetime with code then it insert
'2013-05-30 11:31:47.000'
(这是印度时区的正确时间)
(which is correct time with indian time zone)
但是当我使用getdate()
插入其他列时,它会插入'2013-05-30 06:01:46.507'
but when i use getdate()
to insert in other column it inserts '2013-05-30 06:01:46.507'
- 任何想法我们如何将默认时区设置为印度德里-使用任何数据库设置/azure?
推荐答案
根据MSDN ,getdate()
返回当前数据库系统时间戳:
According to MSDN, getdate()
returns the current database system timestamp:
此值是从计算机上的操作系统派生的 哪个SQL Server实例正在运行.
This value is derived from the operating system of the computer on which the instance of SQL Server is running.
您可以更改tsutil.exe
的时区:
You can change the timezone with tsutil.exe
:
tzutil /s "India Standard Time"
这篇关于在MS SQL Server数据库中设置时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文