Time Zone Question

Discussion in 'ASP .Net' started by Oliver, Dec 30, 2004.

  1. Oliver

    Oliver Guest

    Hello,

    I am writing an application that will be used across multiple time zones
    (Eastern to Pacific) and since much of the application revolves around time
    stamps, I need a best practice for storing time information in a database
    and displaying it correctly to the user (adjusted for his respective time
    zone). I have been thinking about using UTC and adjusting everything when I
    output it, but then the user cannot use the native data in the database
    (e.g. for reporting services).

    Is there any elegant way to do this (my dream would be a session-specific
    time zone setting that will adjust all date to string and string to date
    functions). Anybody had a similar problem?

    I CANNOT SAY HOW MUCH YOUR HELP WILL BE APPRECIATED

    Oliver
    Oliver, Dec 30, 2004
    #1
    1. Advertising

  2. > Anybody had a similar problem?

    Dealing with times across zones is tricky.

    Using UTC and converting (late) seems to be a best practice.

    The reporting issue - you should be able to solve that with some database
    trickery, like UDFs for example. have the user pass his/her timezone into
    the query, along with the time, and then within the UDF produce a UTC and
    use that for the report.


    see also
    http://blogs.msdn.com/brada/archive/2004/04/13/112784.aspx
    http://www.extremeexperts.com/sql/articles/UDFFunctions.aspx

    -D


    "Oliver" <> wrote in message
    news:1104398581.98c45218b842f31c6435ef383bc0ffcc@teranews...
    > Hello,
    >
    > I am writing an application that will be used across multiple time zones
    > (Eastern to Pacific) and since much of the application revolves around
    > time
    > stamps, I need a best practice for storing time information in a database
    > and displaying it correctly to the user (adjusted for his respective time
    > zone). I have been thinking about using UTC and adjusting everything when
    > I
    > output it, but then the user cannot use the native data in the database
    > (e.g. for reporting services).
    >
    > Is there any elegant way to do this (my dream would be a session-specific
    > time zone setting that will adjust all date to string and string to date
    > functions). Anybody had a similar problem?
    >
    > I CANNOT SAY HOW MUCH YOUR HELP WILL BE APPRECIATED
    >
    > Oliver
    >
    >
    Dino Chiesa [Microsoft], Jan 3, 2005
    #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. Ryu

    Time Zone in Windows Time

    Ryu, Sep 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    18,263
    madamut
    Feb 11, 2009
  2. =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=

    prevent a postback when moving web parts from zone to zone.

    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=, Feb 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    576
    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=
    Feb 8, 2006
  3. davout
    Replies:
    3
    Views:
    550
    Roedy Green
    Oct 16, 2003
  4. J.H.Kim

    time adjustment code according to time zone

    J.H.Kim, Oct 24, 2011, in forum: C Programming
    Replies:
    3
    Views:
    459
    Joel C. Salomon
    Oct 24, 2011
  5. Replies:
    9
    Views:
    297
    Michal Kleczek
    May 27, 2013
Loading...

Share This Page