Solved

Figuring out website user's timezone based on UTC offset

Posted on 2012-03-23
1
506 Views
Last Modified: 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.
0
Comment
Question by:mandi224
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 37758174
Do you mean something like this?

    DateTime.UtcNow.AddHours(-5)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question