1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-16 23:27:30 -05:00

return epoc milliseconds for revision date

This commit is contained in:
Kyle Spearrin
2017-01-14 12:47:44 -05:00
parent 174ac313ea
commit 1bef3a1e5b
2 changed files with 15 additions and 2 deletions

View File

@ -7,6 +7,7 @@ namespace Bit.Core.Utilities
public static class CoreHelpers
{
private static readonly long _baseDateTicks = new DateTime(1900, 1, 1).Ticks;
private static readonly DateTime _epoc = new DateTime(1970, 1, 1);
/// <summary>
/// Generate sequential Guid for Sql Server.
@ -57,5 +58,10 @@ namespace Bit.Core.Utilities
certStore.Close();
return cert;
}
public static long EpocMilliseconds(DateTime date)
{
return (long)Math.Round((date - _epoc).TotalMilliseconds, 0);
}
}
}