G
Guest
I have a ASP.NET Ajax app (using client library) calling ASP.NET Ajax-enabled
web services. We are making use of the javascript proxies generated by
ASP.NET Ajax.
The problem we have is that the UTC dates sent by the browser are being
adjusted for timezones by the server, but we do not want dates adjusted for
timezones.
For example, the user enters the date of a transaction as '25 May 2007'.
That ends up as a javascript Date() instance represented as 'Fri May 25
00:00:00 UTC+0100 2007'. This seems fine. But when it ends up in the web
service code, the 1 hour has been subtracted and the date has become
{24/05/2007 23:00:00}. We are not insterested in the time, only the date, and
the date is now wrong.
Is there a way in javascript to get rid of the timezone information from the
date instance? Or is there a way to configure the JSON
serialisation/deserialisation to ignore the timezone? I have hundreds of
objects in the system that use dates, so ideally I want to be able to solve
this "in one place" - custom processing of each date property sends shivers
down my spine.
I'd be grateful for any help!
Stu
web services. We are making use of the javascript proxies generated by
ASP.NET Ajax.
The problem we have is that the UTC dates sent by the browser are being
adjusted for timezones by the server, but we do not want dates adjusted for
timezones.
For example, the user enters the date of a transaction as '25 May 2007'.
That ends up as a javascript Date() instance represented as 'Fri May 25
00:00:00 UTC+0100 2007'. This seems fine. But when it ends up in the web
service code, the 1 hour has been subtracted and the date has become
{24/05/2007 23:00:00}. We are not insterested in the time, only the date, and
the date is now wrong.
Is there a way in javascript to get rid of the timezone information from the
date instance? Or is there a way to configure the JSON
serialisation/deserialisation to ignore the timezone? I have hundreds of
objects in the system that use dates, so ideally I want to be able to solve
this "in one place" - custom processing of each date property sends shivers
down my spine.
I'd be grateful for any help!
Stu