.NET DateTime Purchase Date and Birth Date shifting

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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?
 
Back
Top