I need to compare 2 different dates belonging to different time zones. For that, I would need to convert both of them to a common timezone (locale) or GMT. Which is the function in SQL server that can help me do that ?
There is a function GETUTCDATE() that returns the UTC time. It is obvsiouly based on the settings of the SQL machine. I think you should bring dates to the same timezone than compare them like you do with dates in general (DATEDIFF). Bambola.
There is no automatic way (that I know of) of changing a date's timezone from one zone to another. You could use dateadd to add or subtract the right number of hours from one of the dates to put it in the same timezone as the other... (can get tricky with daylight saving, if you have lots of historic information...)