How do I convert the current time (datetime) in my timezone into another timezone, say France ? I looked around in SO, but did not find any posts which could help me. I am using SQL server 2008.
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
check here
I also agree the correct SQL Query is using
GetUTCDate()
as you see in the screenshot.Please replace getdate() with GetUTCDate() to get accurate result otherwise the offset (5:30) in this case will be added to the current time (which will already have some offset) and will result in incorrect result.
For instance if you are in Pakistan then GetDate() will give you time as GMT+5:00 and adding 5:50 offset in this time will result in GMT + 10:30 which is totally wrong.