Yes, it is a time zone issue, even though both machines are in the same time
zone and have the same system date.
I solved it in my class by converting it to universal time before storing
it.
public class MatchData
{
private DateTime dtBirthDate_m;
public string PHN;
public string GivenName;
public string FamilyName;
public string Gender;
public DateTime BirthDate
{
set
{
dtBirthDate_m = value.ToUniversalTime();
}
get
{
return dtBirthDate_m.ToLocalTime();
}
}
[System.Xml.Serialization.XmlIgnore]
public DateTime BirthDateUTC
{
set
{
dtBirthDate_m = value;
}
get
{
return dtBirthDate_m.ToUniversalTime();
}
}
}
[quoted text, click to view] "Franklin M. Gauer III" <FranklinMGauerIII@discussions.microsoft.com> wrote
in message news:2B7D95CB-EBC9-44B5-81CF-E624B916C709@microsoft.com...
>
> Yes - depending on where your webserver is and where your client is - a
> timezone conversion will be done. If the webserver is set to a different
> timezone than your client - this will occur.
>
> I'm not aware of a system setting that will prevent this from happening
> (if
> you don't want it to happen - maybe someone else on the forums knows).
> We've
> taken care of this in the past by writing functions that 'take away' this
> effect when we pass dates up to our webservices.
>
> --
> Franklin M. Gauer III
> Applications Development Manager
> Integrated Companies, Inc.
>
>
> "John Saunders" wrote:
>
>> "Jeremy Chapman" <please@Idontlikespam> wrote in message
>> news:eCZjkln4GHA.1200@TK2MSFTNGP02.phx.gbl...
>> > I've created a web service method which looks like
>> > public MatchResult CheckMatch(MatchData MatchValues)
>> >
>> > MatchData is a class defined as:
>> > public class MatchData
>> > {
>> > public string GivenName;
>> > public string FamilyName;
>> > public DateTime BirthDate;
>> > public string Gender;
>> > }
>> > When I call the web service, I set the BirthDate property to March 3,
>> > 1997, and when I trace the soap call I see that the date is
>> > "1997-03-02T16:00:00.0000000-08:00"
>> > In my web service, I debug it and when I inspect the MatchData
>> > instance, I
>> > see that the BirthDate property contains 1997-03-02 as the date and
>> > 16:00
>> > as the time. Now, the date is 1 day off. Anyone know what causes this
>> > and how to fix it?
>>
>> This looks like a time zone problem. "March 3, 1997" in which timezone?
>> Pacific (-8)?
>>
>> What's the offset from where you are to GMT? 13? So, maybe
>> 1997-03-02T16:00
>> + 13 = 1997-03-03T05:00?
>>
>> I'm not completely sure, but this does seem like a timezone issue.
>>
>> John
>>
>>
>>