locked
Creating a world clock app that accounts for Daylight Savings Time RRS feed

  • Question

  • User-1380711633 posted

    I need to create an application that displays the local time for a user, plus a drop down that allows them to select one of dozens of locations around the world and display the local time in that location.  It has to be a real-time clock, that is, a clicking clock, not a static time displayed upon load. 

    I had something written in JavaScript that displayed a realtime clock and then handled normal GMT/UTC deviations for any selected location.  This wasn't too bad.  Then I realized that it didn't take into account that some of the locations use DST and at different times of the year and for certain durations.  I had thought about trying to use .NET to somehow tap into the user's local Date and Time settings which seem to have Time Zone data at the OS level, but I have no idea how to get to that data, and it seems like having the user's local time be the basepoint and them having the ability to check/uncheck to adjust for DST is going to be problematic.

    Basically, I need to be able to get a reliable current time for anywhere in the world, regardless if they are currently within DST or not.  And, I need to be able to plug the data into my current client script so the values can be real-time and not rely on post-backs (what a nightmare that would be!).

    Has anyone had any experience in doing this successfully in a production environment?  This is for internal use, not commercial use.  It will be used on our Intranet home page.

    Any advice is greatly appreciated.

    Thanks,

    Jay

    Monday, November 20, 2006 12:35 PM

All replies

  • User1416329745 posted

    I don't know how it is done because it is very complex but what you are looking for already exist.  Hope this helps.

    http://www.timeanddate.com/

    Monday, November 20, 2006 4:50 PM
  • User1347187933 posted

    Hi,

    Daylight saving is kept changing according to local law or policy though is not that frequent. In your scenario, I think you can just keep a list of locations if they have Daylight Saving.

     http://www.timeanddate.com/time/dst2004b.html

     

    Wednesday, November 29, 2006 2:15 AM