Time conversion from local to UTC and vice-versa

Spread the love

Recently I have been working on setting up baselining for my SQL Server lab environment. As part of baselining, I capture all the required Perfmon counters both at SQL Server and OS.

But, Grafana requires time in UTC format. Since all the data collection in my case was in local server time using GETDATE(), I had to write below 2 functions in order to convert server time to UTC and vice-versa.

I hope this would be helpful to anyone having similar use case like me.

Happy coding 🙂

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.