How to convert Date and time in IST in SQL ServerAsk Questions

 Posted on 01/05/2019

I have my dedicated server which is from CA, USA. When I use sql query for any datetime fields, it always return USA timezone in result. Is it possible to retrieve date in our local format like Indian date and time by using sql query?

Any help appreciated.


Share On: facebook gplus twitter
Asked by Haresh Chaudhari on 01/05/2019 Score: 255 points
Add Comment:


1 Answers

1 Corrected Answers
Aproved Answers
Answered by Narendra Shah on 1/18/2019 11:58:51 AM Score: 95 points

Hi Haresh, its possible but there might be small variation to display exact time. I have used following query and I am able to get IST time format with date as well.

select switchoffset(sysdatetimeoffset(), '+05:30')


2019-01-18 16:26:07.0848913 +05:30


SELECT switchoffset(GetDate(), '+05:30')


2019-01-18 17:27:30.787 +05:30


Both sql used for same purpose but still we can see minor variation in time. You may use it as per you need and add tweak as well if needed.

I hope this helps you.

Thank you



Add Comment:

Post Your Answers

Existing Members

Sign in to your account
Email Address
New Member?
Sign up and complete profile
Full Name
Email Address
I have read and agree to the Terms of Service and Privacy Policy
Please subscribe me to the StoodQ newsletters
Guideline to answer a question:

Useful tips to submit your answer
Please read below guidelines before you submit your answer for question.

  • Read and understand question for which you are submitting your answer.
  • Try to avoid grammatical and spell mistake while answering.
  • Do not post any irrelevant information in your answer.
  • Explain your answer with example or any reference link to help who posted question.
  • If you find irrelevant question, please report it to support. Click here to contact support.
  • You agree to the privacy policy and terms of use to submit any contents.

Note: StoodQ is online developers community which helps developer for their difficulty, lets help them with your value contribution.