Home All Groups Group Topic Archive Search About

Remove Time Zone Information From Date

Author
27 Feb 2007 8:04 PM
Elroyskimms
I've recently made the switch from .Net v1.1 to .Net v2.0 and I
noticed some quirky behavior. Part of our system includes a web
service, which takes a date value as one of its parameters,
representing the birthday. Apparently, .Net 2.0 adds additional time
zone information to all date data types, so if the client system sends
a birthday of March 1, 1980 , it converts it to March 1, 1980 local
time according to the client. If the server is in PST (-8) and the
client is in EST (-5), the server will convert the date to Feb 28,
1980 @ 9:00PM.

I know that entire wars have been fought over the issue of ISO time
standards and the benefits of globalization, and I'm not looking to
discuss the merits of any method, I just need to know how to make this
work. How can I make a date, nothing more than a date? Can I have a
date that is not time specific? I'm not looking for midnight on a date
in a specific time zone, I just want the date off the calendar. How
can I do this?

Keep in mind that I cannot control the time standard which the client
is sending. They may be using the ISO standard which includes the
timezone information: 1980-03-01T00:00:00.0000000-5:00 (I think that
is how it looks), or they may be hardcoding the SOAP content and
sending 1980-03-01, which will pass validation. How can I account for
this?

Please help!

AddThis Social Bookmark Button