Solved

World Clock

Posted on 2010-11-12
5
1,416 Views
Last Modified: 2012-06-27
I need to display times for 6 locations around the world on a local server, including the current time where the web server sits.
I also need to adjust for DST.

Is there a straight-forward way of doing this?
0
Comment
Question by:devo00
  • 3
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Here's a link to info about 'tzdata', a public domain time info database: http://en.wikipedia.org/wiki/Tz_database   I don't find a link to C# code right off but there probably is sample code somewhere.  tzdata is frequently updated.
0
 
LVL 10

Expert Comment

by:Mez4343
Comment Utility
I would try to use an existing web service that provides that functionality. There is a free one with sample code here. http://www.csharphelp.com/2006/10/consuming-a-web-service-in-c/

If you only need 6 locations and not the whole world, then maybe this is project will get you started. http://www.codeproject.com/KB/selection/3ZoneWorldClock.aspx
0
 

Author Comment

by:devo00
Comment Utility
Even with improvements in ASP.NET 3.5, it's this involved?
0
 

Accepted Solution

by:
devo00 earned 0 total points
Comment Utility
This 'seems' to be the answer I'm looking for, does not require the larger efforts noted above, and accommodates DST:

Using the .NET 3.5 TimeZoneInfo object:

DateTime oldTime = new DateTime(2007, 6, 23, 10, 0, 0);
TimeZoneInfo timeZone1 = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
TimeZoneInfo timeZone2 = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
DateTime newTime = TimeZoneInfo.ConvertTime(oldTime, timeZone1, timeZone2);

Open in new window


Chris Pietschmann
0
 

Author Closing Comment

by:devo00
Comment Utility
Found a good, succinct, working solution in my own search efforts.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

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!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

18 Experts available now in Live!

Get 1:1 Help Now