Can time zone be ignored in a DateTime DataColumn deserialization?

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hello,

We serialize a DataTables that have columns which are DateTime. When the
DataTable is deserialized it displays the date in the local time zone
instead of the time the date was saved as.

We actually don't even display the time portion, we just use the date but
since the default time is 12:00AM, when the file is open in another time
zone say -3 the date shows the prior date.

I know this is expected behaviour but it's not what we want.

Any ideas?

Thanks,
Joe
 
Hello Joe,

This can be resolved by setting DateTimeMode to default NO OFFSET. See
comments in this link,
https://connect.microsoft.com/wcf/feedback/details/488856/datetime-values-in
-a-dataset-shifted-by-timezone?wa=wsignin1.0

"Basically, I think the default DateTimeMode ( which can be edited on a
datetime column in the dataset designer ) should default to a time mode
that does not apply an offset on serialization. I think that is the issue,
when you serialize, by default NO OFFSET should be applied. But the default
datetimemode in a dataset designer is to UnspecifiedLocal, which applies an
offset.

You can ( at least you should be able to ) change the default DateTimeMode
in the dataset designer, and get the correct serialization behavior."

And we have migrated our managed newsgroup support to the MSDN forum
platform. So if, in futhure, you have any questions regarding to .NET or
C#, you can find corresponding MSDN Forum to get prompt support. Here is
the list of the current managed forum.
http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx

Here are C# and BCL forums,
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads
http://social.msdn.microsoft.com/forums/en-US/netfxbcl/threads/


Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
 
Back
Top