Avatar of Steve A
Steve A
Flag for United States of America asked on

Getting local user timezone in Sql Server

How can I get the user's local time zone and not the servers time zone?

If I have a user in California and the server location is in New York,
I want to retrieve both the time zones within Sql Server but seem to can only retrieve the server - Eastern time zone.
I can have users in PST, MST and CST time zones, but I need their time zone to get real time stamp data for auditing
purposes, etc.

Thanks.

Sql Server 2008
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
Steve A

8/22/2022 - Mon
lludden

For auditing you should always use GMT time and let the front-end translate that to the local time.  The SQL Function is SYSUTCDATETIME()
Dave Baldwin

Since the SQL Server does not have access to the client, it can not get the local time for each user.
ASKER CERTIFIED SOLUTION
Jason clark

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Steve A

ASKER
Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23