Figuring out website user's timezone based on UTC offset
Posted on 2012-03-23
I am using ipinfodb.com to detect a website visitor's IP address and figure out their city and timezone. For instance, I can detect city = "ATLANTA" and timezone = "-05:00"
How to I figure out the exact date/time where they are -- I understand I can get UTC time by doing DateTime.UtcNow -- but how do I apply the "-05:00" to UTC to adjust the resulting date/time?
I've done Google searches but all I have come up with is using TimeZoneInfo.FindSystemTimeZoneById -- but this requires a string value of a location, which I don't have. I have the numerical offset hours instead.