Dataset converting date field accross time zones...

S

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.
 
C

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
 
S

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.
 
C

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
 
S

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top