I want to generate a Guid v.1 from a DateTime. I try to use the class described here:
But after getting a DateTime from a Guid, I tried to get the same Guid as the original using that DateTime, and it gave me a different Guid. Here's the code I used:
string uuidString = "9e5713bb-bb4c-11e8-9d6c-12345678df23";
Guid gui = new Guid(uuidString);
DateTime dateTimeFromGuid = GuidGenerator.GetDateTime(gui);
Console.WriteLine(dateTimeFromGuid.ToString("dd/MM/yyyy hh:mm:ss"));
Guid guidFromDateTime = GuidGenerator.GenerateTimeBasedGuid(dateTimeFromGuid);
Console.WriteLine(guidFromDateTime); //7909dbbb-bb33-11e8-9f6a-95d8e90ccf10
How can I get the original GUID back from a DateTime?