Convert UTC DateTime to Local Time (Not My Local Time)

Discussion in 'ASP .Net' started by Jonathan Wood, Oct 31, 2009.

  1. I have a DateTime value that represents a UTC time (DateTime). I also have a
    UTC offset value (double) and a Daylight Savings Time value (bool) for a
    local time. How best to calculate the local time from this data?

    I've been searching the web for a while now. I've found a lot of interesting
    new classes and various ways to approach this. But not one is dealing with
    data in the form described above.

    More Info:

    I'm building a website where people can post comments. The date of each
    comment is stored in the database as UTC time. My site also needs to track
    which region each user is from. So my region table contains time zone
    information which I need to apply to the UTC time. I'm opening to storing
    different data types, etc. But I don't want to make this much more
    complicated.

    Thanks.

    Jonathan
    Jonathan Wood, Oct 31, 2009
    #1
    1. Advertising

  2. I'm aware of that--I'm involved in that discussion. But it is not being
    productive. So, if someone wants to weigh in here, why not let them?

    > This question is already being discussed in the C# newsgroup...


    Jonathan
    Jonathan Wood, Nov 1, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?aGVuaw==?=

    Covert UTC String to UTC Datetime

    =?Utf-8?B?aGVuaw==?=, May 7, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    18,728
    Egbert Nierop \(MVP for IIS\)
    May 7, 2006
  2. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    702
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  3. Tim Peters
    Replies:
    0
    Views:
    529
    Tim Peters
    Sep 9, 2003
  4. Replies:
    1
    Views:
    793
    Paul Boddie
    Mar 11, 2007
  5. Justin Voelker
    Replies:
    2
    Views:
    263
    Dr J R Stockton
    Dec 2, 2008
Loading...

Share This Page