.NET DateTime Purchase Date and Birth Date shifting

G

Guest

Birth Date and a Purchase Date aata is being stored in sql. This information
is retrieved across time zones through a .Net Web Service. When the data is
viewed in a .Net client application these dates are shifted due to time zone
differences. Anyone know the best way to stop this ffrom happening?
 
K

Kevin Spencer

First, it depends on how the DateTime values are stored. Are they stored as
local DateTimes or UTC DateTimes? I would recommend storing them as UTC
DateTimes, and then the client can simply convert it to local.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
 
G

Guest

I have set up a tester where i am storing the Dates in UTC format in Sql. I
then pull it out of sql still in UTC and pass it on to the client through a
web service. I save the file on my machine so i can reopen it as i move
through time zones. I then display the value in a text box to see what i get.
As i move through time zones on my machine and reopen the tester i notice
that even the utc time is shifting and eventually the date shifts to the day
before the actual purchase or birth date. Any ideas?
 

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