tags:

views:

158

answers:

2

My Server is located in US and I am running a query against it. The Data contained in the table both at Remote Server(U.S) and Local are same.

The Problem is when I am retrieving the DataSet using WebService from Remote Server. The Dates Column is showing The Previous Date. For e.g Date Column is having "14 Jan 2007" but when retrieved its Showing "13 Jan 2007".

I am not able to identify the cause as every other thing is working fine.

+1  A: 

There are issues with times in datasets, at least in .net 1.1. The dataset automatically adjust the time to the time zone of the client. My guess is your client is set to a timezone that is farther west than the server. In turn, the this pushes the time back a few hours, causing the date to move from 14 Jan 2007 to 13 Jan 2007.

Take a look at this KB article.

Paul Whitehurst
I have converted the DateTime to a varchar. I hope this will solve the Issue
A: 

Perhaps the localization of the database is not what the dataset is expecting. I'm not sure the exact specs, but for example, it might be storing the value as EDT but expecting it to be UTC. So what you might see in the database file could be 14-Jan-2007 12:00am, but when it localizes it to US time you get 13-Jan-2007 4:00pm or something?

Check the time as well and not just the date and see if you can identify a pattern. Then you maybe can adjust accordingly.

lc