Changing the output of Getdate

北城余情 提交于 2019-11-28 13:24:32

According to the documentation for getdate():

This value is derived from the operating system of the computer on which the instance of SQL Server is running.

Since it's derived from the OS, I don't think you can change it separately.

You can always wrap GetDate() in a custom function and use that everywhere, although it's not an optimal solution.

No, there is not much you can do other than something like this:

SELECT GETDATE()-7  --get date time 7 days ago
SCOTT
SELECT DATEADD(dd, -7, GETDATE())
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!