Solved

Figuring out website user's timezone based on UTC offset

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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.…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

863 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

20 Experts available now in Live!

Get 1:1 Help Now