I have SQL Server installed on a Centos. I set the server date and time to my local date time and it is OK. But when I run getdate()
in SQL Server it gives date and time based in the US time zone. I know I can get the date and with offset options but I need get the local date and time just with getdate()
.
How can I force SQL Server to get date and time from the operating system (Centos)?
2
Answers
I reinstall the sqlserver after setting the operating timezone and solved the problem.
Try install tzdata :
set correct timezone:
then run tzselect choose correct timezone:
finally, restart mssql: