Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel.S 50 posts 135 karma points
    Jul 17, 2009 @ 08:12
    Daniel.S
    0

    Accounting for difference in timezone between server and webpage audience

    Hello all.

    I'm working on a page that is going to be hosted on a server in Norway, but the main target audience will be in Sydney, Australia.

    Is there any way in .NET to account for this time difference automatically, or will I have to hard-code the time change into my XSLT templates?

    For example, I'm showing dates from a Google calendar feed that's set to UTC +10 (AEST), but the server's time is UTC +1. This means that if I configure my google events to show what's happening "today" when viewed in Sydney, there will still be events from the previous day showing - as Norway is ~9 hours behind us.

    Any ideas are much appreciated.

    Thanks,

    Daniel

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 17, 2009 @ 09:22
    Morten Bock
    0

    I know this is kind of a non-answer, but as far as I can tell, there is no way to change the timezone globally for you web app. So I guess the best way sould be to put an entry in a config file, and then make a date helper class the makes the timezone conversion for you.

  • Ron Brouwer 273 posts 768 karma points
    Jul 17, 2009 @ 09:36
  • Daniel.S 50 posts 135 karma points
    Jul 19, 2009 @ 01:01
    Daniel.S
    0

    Ron, that will be handy if I have to create a helper function to calculate the time difference. It seems that this is the only way to go.

    I noticed yesterday that someone had the same problem on Codeplex, but there was no firm solution found there either - only the suggestion to store the difference in UTC offset and calculate the difference: http://stackoverflow.com/questions/889504/asp-net-app-and-local-timezone.

    Just wondering if anyone else has a solution to this?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies