Yes, of course! Thanks so much!
This does not account for daylight saving time.
Hi Paw,I guess it depends on what you mean "account for". For my purposes, I was using it to get the difference between UTC and server time. This does exactly that. That is the offset that I wanted. It did me little good to know the offset and then have to adjust it depending on the calendar of DST.I'm not sure what your usage, is, but it works great depending on your goal I guess.
Note this doesn't take account of timezones that aren't whole hours from UTC, e.g. India.
Anonymous,Good point. This is true, it doesn't take minutes into account. However, you can change the hh to a mm. This will give the difference in minutes. You can then divide by 60 to get the hours.
I dont know if this is what you meant..DECLARE @value VARCHAR(100);EXEC xp_regread "HKEY_LOCAL_MACHINE","System\CurrentControlSet\Control\TimeZoneInformation","StandardName",@value OUTPUTSELECT @value;
Post a Comment