Created
October 2, 2015 22:33
-
-
Save i3arnon/955437b41d566170c135 to your computer and use it in GitHub Desktop.
Replacing EpochOrigin fixes the issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typeof (BclHelpers). | |
GetField("EpochOrigin", BindingFlags.NonPublic | BindingFlags.Static). | |
SetValue(null, new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)); | |
var dolly = new Sheep {DateOfBirth = new DateTime(1966, 07, 05, 11, 0, 0, DateTimeKind.Utc)}; | |
Console.WriteLine(dolly.DateOfBirth.ToString("HH:mm:ss K")); // "11:00:00 Z" (Z means UTC) | |
dolly = Serializer.DeepClone(dolly); // Serialize and deserialize using protobuf-net | |
Console.WriteLine(dolly.DateOfBirth.ToString("HH:mm:ss K")); // "11:00:00 Z" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment