Home All Groups Group Topic Archive Search About

Dataset converting date field accross time zones...

Author
25 Apr 2006 5:44 AM
Subrata
I need help wrt to the dataset converting the date (time) when passed from a
web server to a client, both on different time zones.
Lets assume that the Web Server is in NYC(EST). The client is in SFO(PST).
The client is making a web service call to the WS in NYC, which returns a
dataset containing a date field. The client is also interested only in the
date part of it. But, if the WS is returning the date as "04/25/2006
00:00:00 EST", when it gets to the client, the date in the dataset is
getting converted to "04/24/2006 21:00:00 PST". So, as the client is only
interested in the date part, he's getting it wrong (the client is getting
04/24 instead of 04/25).
This looks to me like a generic problem. Has anybody faced it before? What
would be the most efficient solution for this problem (other than passing
the date as a string in the dataset and converting it back to date in the
client side?)?

We are using .NET Framework 1.1 with Visual Studio 2003 on Windows 2000/XP.

Thanks for your help.

Author
25 Apr 2006 6:17 AM
Cor Ligthert [MVP]
Subrata,

May I sumarize what you wrote
The dates are as on the server.
Dates are showed at the client as they are than in fact as they should be
relates to his/her timezone to UTC.

What is it that you want?

Cor
Author
25 Apr 2006 6:23 AM
Subrata
Our requirement is to pass the 'date' part from the server to the client,
'unchanged'. This means that we do not want the timezone conversion to
happen on the date field. Dataset is doing the timezone conversion for the
date field intrinsically, which we *do not* want.
Hope this clarifies.


Show quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:O5uT5%23CaGHA.4612@TK2MSFTNGP03.phx.gbl...
> Subrata,
>
> May I sumarize what you wrote
> The dates are as on the server.
> Dates are showed at the client as they are than in fact as they should be
> relates to his/her timezone to UTC.
>
> What is it that you want?
>
> Cor
>
>
>
Author
25 Apr 2006 7:02 AM
Cor Ligthert [MVP]
Subrata,

As you with this, than I would do it as it is done with an HTML/ASP(Net)
webpage. Just as a stringformat and than parse it back to a DateTime on the
client. Be aware that it can be very confusing, so don't forget to set it
very clear on the screen.

There are probably more possibilities, but this one seems for me the most
easy one.

I hope this helps,

Cor


Show quote
"Subrata" <Subrata@newsgroups.nospam> schreef in bericht
news:%234oKFDDaGHA.1192@TK2MSFTNGP04.phx.gbl...
> Our requirement is to pass the 'date' part from the server to the client,
> 'unchanged'. This means that we do not want the timezone conversion to
> happen on the date field. Dataset is doing the timezone conversion for the
> date field intrinsically, which we *do not* want.
> Hope this clarifies.
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:O5uT5%23CaGHA.4612@TK2MSFTNGP03.phx.gbl...
>> Subrata,
>>
>> May I sumarize what you wrote
>> The dates are as on the server.
>> Dates are showed at the client as they are than in fact as they should be
>> relates to his/her timezone to UTC.
>>
>> What is it that you want?
>>
>> Cor
>>
>>
>>
>
>
Author
26 Apr 2006 4:37 AM
Stephen Ahn
Subrata,

Yes, this is a known issue.
One possibility is to write a Soap Extension, which you run on both the
server and client ends. This extension would manually adjust the serialized
date times, so that to the end receiving the data, the date/time looks like
a local time. Once its working, the timezone differences are transparent to
your app - both ends behave as if they were in the same time zone.

Stephen

Show quote
"Subrata" <Subrata@newsgroups.nospam> wrote in message
news:eVxuCtCaGHA.5000@TK2MSFTNGP05.phx.gbl...
>I need help wrt to the dataset converting the date (time) when passed from
>a web server to a client, both on different time zones.
> Lets assume that the Web Server is in NYC(EST). The client is in SFO(PST).
> The client is making a web service call to the WS in NYC, which returns a
> dataset containing a date field. The client is also interested only in the
> date part of it. But, if the WS is returning the date as "04/25/2006
> 00:00:00 EST", when it gets to the client, the date in the dataset is
> getting converted to "04/24/2006 21:00:00 PST". So, as the client is only
> interested in the date part, he's getting it wrong (the client is getting
> 04/24 instead of 04/25).
> This looks to me like a generic problem. Has anybody faced it before? What
> would be the most efficient solution for this problem (other than passing
> the date as a string in the dataset and converting it back to date in the
> client side?)?
>
> We are using .NET Framework 1.1 with Visual Studio 2003 on Windows
> 2000/XP.
>
> Thanks for your help.
>

AddThis Social Bookmark Button