AJAX Web Applications and Time Zones

Michael Schwarz on Friday, July 7, 2006

Because I'm currently playing with a lot of AJAX frameworks I'm searching for the correct use of dates and times in web applications. Ajax.NET Professional [1] is using time zone indentifier to know from which time zone the request is comming from. See following server-side C# code:

[AjaxMethod]
public static DateTime GetCurrentTime()
{
return DateTime.Now;
}

Calling this method should return the same date as calling new Date() on the client-side JavaScript code (with the difference of the request duration). Atlas [2] is not returning the time zone which will end in a different time when calling above method.

How does this effect web farms where one of the web server is running in a different time zone, is this possible? And, when I look at DNS configuration of some A records I see that there are multiple IP addresses defined. When the web servers for each IP address is located in a different time zone you will have the same problem when dates do not include time zones.

What do you think is the right way? New Example available at http://berlin.schwarz-interactive.de/ [3].