Convert stored UTC time to webuser's local time?

Discussion in 'ASP .Net' started by Mark B, Sep 24, 2009.

  1. Mark B

    Mark B Guest

    ASP.NET 3.5, VB.NET.

    In ASP.NET, I have a DateTime variable which I assign from an SQL database
    UTC Date field:

    dtFirstMeetingDateTime (e.g. September 30, 2009 3:44:00 PM UTC)

    I need to display this on a webpage in the webuser's format and time. They
    can be anywhere and in any language around the world. E.g., I need to
    display the string:

    "30/09/2009 4:44:00 AM (New Zealand Daylight Time)"


    If anyone can help with the code needed to do this I'd appreciate it a lot.
     
    Mark B, Sep 24, 2009
    #1
    1. Advertisements

  2. The easiest way is to show a list of available time zones (TZ) where
    user can select one of them. Another approach could be to use js to
    submit client time to the server where you could define client's TZ.
     
    Alexey Smirnov, Sep 24, 2009
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.