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.
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.
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
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.
You could take a look at the following http://msdn.microsoft.com/en-us/library/system.globalization.daylighttime.aspx
Ron
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?
is working on a reply...