diff --git a/Commons.cs b/Commons.cs index 86c1903..4be7b2d 100644 --- a/Commons.cs +++ b/Commons.cs @@ -101,10 +101,10 @@ internal static class Commons } } - internal static string GenerateUuidV7() + internal static string GenerateUuidV7(DateTime? BaseTime = null) { Span uuidBytes = stackalloc byte[16]; - long time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + long time = (BaseTime is null ? DateTimeOffset.UtcNow : new DateTimeOffset((DateTime)BaseTime)).ToUnixTimeMilliseconds(); RandomNumberGenerator.Fill(uuidBytes[7..]); if (BitConverter.IsLittleEndian) {