Solved

Figuring out website user's timezone based on UTC offset

Posted on 2012-03-23
1
499 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now