Visual Basic .NET » ASP.NET General Discussion
AJAX Web Applications and Time Zones -- Michael Schwarz --


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 is using time zone indentifier to know from which time zone the request is comming from. See following server-side C# code:


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 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?

Example available at
http://berlin.schwarz-interactive.de 
/.

--
Best regards | Schöne Grüße Michael

Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz 
/
http://www.schwarz-interactive.de 
/
mailto:info
-- Jon Ceanfaglione --

Michael

I am not aware of too many server farms running in different time-zones.
Meaning, I doubt someone would set-up their farm to load balance a request from one server in one time-zone to another server in a different timezone.
I believe anything is possible though. One of my bigger frustrations with Atlas has been the handling of dates and time. I suspect if timezones are of big importance to an application you would just store the date as GMT and allow a user to select their timezone as a configurable setting.

On 7/7/06, Michael Schwarz wrote:


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 is using time zone indentifier to know from
which time zone the request is comming from. See following server-side
C# code:


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 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?

Example available at
http://berlin.schwarz-interactive.de 
/.

--
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz 
/
http://www.schwarz-interactive.de 
/
mailto:info

>


 

-- Michael Schwarz --


Hi,

all web browsers have currently the time zone in their Date object, so it is very easy to handle this (as AjaxPro is doing). If you want to deal with a different time zone on the local PC it should be very easy to do this.

But you think returning the time in the local time zone is the correct way, too? I think sometimes it depends on the web application, but I think nearly 90% will need the correct local time.

Regards,
Michael

On 7/7/06, Jon Ceanfaglione wrote:
Michael

I am not aware of too many server farms running in different time-zones.
Meaning, I doubt someone would set-up their farm to load balance a request
from one server in one time-zone to another server in a different timezone.
I believe anything is possible though. One of my bigger frustrations with
Atlas has been the handling of dates and time. I suspect if timezones are
of big importance to an application you would just store the date as GMT and
allow a user to select their timezone as a configurable setting.
On 7/7/06, Michael Schwarz wrote:
>

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 is using time zone indentifier to know from
which time zone the request is comming from. See following server-side
C# code:


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 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?

Example available at
http://berlin.schwarz-interactive.de 
/.

--
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz 
/
http://www.schwarz-interactive.de 
/
mailto:info
>



--  

Best regards | Schöne Grüße Michael

Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz 
/
http://www.schwarz-interactive.de 
/
mailto:info
-- Jon Ceanfaglione --

Michael

I am not aware of too many server farms running in different time-zones.
Meaning, I doubt someone would set-up their farm to load balance a request from one server in one time-zone to another server in a different timezone.
I believe anything is possible though. One of my bigger frustrations with Atlas has been the handling of dates and time. I suspect if timezones are of big importance to an application you would just store the date as GMT and allow a user to select their timezone as a configurable setting.

On 7/7/06, Michael Schwarz wrote:


Hi,

all web browsers have currently the time zone in their Date object, so
it is very easy to handle this (as AjaxPro is doing). If you want to
deal with a different time zone on the local PC it should be very easy
to do this.

But you think returning the time in the local time zone is the correct
way, too? I think sometimes it depends on the web application, but I
think nearly 90% will need the correct local time.

Regards,
Michael

On 7/7/06, Jon Ceanfaglione wrote:
> Michael
>
> I am not aware of too many server farms running in different time-zones.
> Meaning, I doubt someone would set-up their farm to load balance a
request
> from one server in one time-zone to another server in a different
timezone.
> I believe anything is possible though. One of my bigger frustrations
with
> Atlas has been the handling of dates and time. I suspect if timezones
are
> of big importance to an application you would just store the date as GMT
and
> allow a user to select their timezone as a configurable setting.
>
>
> On 7/7/06, Michael Schwarz wrote:
> >
>
> 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 is using time zone indentifier to know from
> which time zone the request is comming from. See following server-side
> C# code:
>
>

> 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 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?
>
> Example available at
http://berlin.schwarz-interactive.de 
/.
>
> --
> Best regards | Schöne Grüße
> Michael
>
> Microsoft MVP - Most Valuable Professional
> Microsoft MCAD - Certified Application Developer
>
>
http://weblogs.asp.net/mschwarz 
/
>
http://www.schwarz-interactive.de 
/
> mailto:info
>
>
> >
>
>
>
>
>
--
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz 
/
http://www.schwarz-interactive.de 
/
mailto:info

>


 

-- Jon Ceanfaglione --

Personally, I'd prefer to get the date object in the exact format it is in the database. As I said before, if a have an application that needs strict localization, I would then just store the date as GMT and do whatever conversion I need at runtime using the time-zone offset.

On 7/7/06, Michael Schwarz wrote:


Hi,

all web browsers have currently the time zone in their Date object, so
it is very easy to handle this (as AjaxPro is doing). If you want to
deal with a different time zone on the local PC it should be very easy
to do this.

But you think returning the time in the local time zone is the correct
way, too? I think sometimes it depends on the web application, but I
think nearly 90% will need the correct local time.

Regards,
Michael

On 7/7/06, Jon Ceanfaglione wrote:
> Michael
>
> I am not aware of too many server farms running in different time-zones.
> Meaning, I doubt someone would set-up their farm to load balance a
request
> from one server in one time-zone to another server in a different
timezone.
> I believe anything is possible though. One of my bigger frustrations
with
> Atlas has been the handling of dates and time. I suspect if timezones
are
> of big importance to an application you would just store the date as GMT
and
> allow a user to select their timezone as a configurable setting.
>
>
> On 7/7/06, Michael Schwarz wrote:
> >
>
> 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 is using time zone indentifier to know from
> which time zone the request is comming from. See following server-side
> C# code:
>
>

> 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 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?
>
> Example available at
http://berlin.schwarz-interactive.de 
/.
>
> --
> Best regards | Schöne Grüße
> Michael
>
> Microsoft MVP - Most Valuable Professional
> Microsoft MCAD - Certified Application Developer
>
>
http://weblogs.asp.net/mschwarz 
/
>
http://www.schwarz-interactive.de 
/
> mailto:info
>
>
> >
>
>
>
>
>
--
Best regards | Schöne Grüße
Michael

Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer

http://weblogs.asp.net/mschwarz 
/
http://www.schwarz-interactive.de 
/
mailto:info

>


 

[Submit Comment]Home