Skip to content

Commit fe47c7d

Browse files
committed
use DateTime.UtcNow
1 parent 392d920 commit fe47c7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/Samples/Sample01_BasicUsage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void SerializeThenDeserialize()
4444
{
4545
Id = 123,
4646
Title = "My photo",
47-
Date = DateTime.Now,
47+
Date = DateTime.UtcNow,
4848
Image = new byte[] { 1, 2, 3, 4 },
4949
Comment = "This is test object to be serialize/deserialize using MsgPack."
5050
};
@@ -69,7 +69,7 @@ public void SerializeThenDeserialize()
6969
Debug.WriteLine( "Same Id? {0}", targetObject.Id == deserializedObject.Id );
7070
Debug.WriteLine( "Same Title? {0}", targetObject.Title == deserializedObject.Title );
7171
// Note that MsgPack defacto-standard is Unix epoc in milliseconds precision, so micro- and nano- seconds will be lost. See sample 04 for workaround.
72-
Debug.WriteLine( "Same Date? {0}", targetObject.Date.ToString( "yyyy-MM-dd HH:mm:ss.fff" ) == deserializedObject.Date.ToLocalTime().ToString( "yyyy-MM-dd HH:mm:ss.fff" ) );
72+
Debug.WriteLine( "Same Date? {0}", targetObject.Date.ToString( "yyyy-MM-dd HH:mm:ss.fff" ) == deserializedObject.Date.ToString( "yyyy-MM-dd HH:mm:ss.fff" ) );
7373
// Image and Comment tests are ommitted here.
7474
// Collection elements are deserialzed.
7575
Debug.WriteLine( "Items count: {0}", deserializedObject.Tags.Count );

0 commit comments

Comments
 (0)