tonynhan / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

Deserialization of DateTime issue in C# 2.0 #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
E-mail:Cuchuk.Sergey@gmail.com

Datetime working c#

The process of testing protobuf net is the next
xml input file->xml deserialization->obj with datetime field->proto
serialization & deserialization to obj2->Xml serialization of obj2 to
output file
Both files are compared using winmerge and seems to be different for datetime

When to compare the initial serialization(in input file)
<auditDate>2009-08-22T11:46:07.4656165+03:00</auditDate>

and result xml representation
<auditDate>2009-08-22T11:46:07.4656165</auditDate>

there's a difference

Here's the code for field
        /// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaFo
rm.Unqualified,
IsNullable=true)]
        [ProtoMember(6, IsRequired = true, Name = @"time", DataFormat =
DataFormat.Default)]
        public System.Nullable<System.DateTime> time {
            get {
                return this._time;
            }
            set {
                this._time= value;
            }
        }

Original issue reported on code.google.com by Cuchuk.S...@gmail.com on 21 Aug 2009 at 6:12

GoogleCodeExporter commented 9 years ago
*<auditDate>
<time>

and

*</auditDate>
</time>

Original comment by Cuchuk.S...@gmail.com on 21 Aug 2009 at 6:18