diff --git a/src/Api/Controllers/AccountsController.cs b/src/Api/Controllers/AccountsController.cs index 181d459d2..8da02bcdf 100644 --- a/src/Api/Controllers/AccountsController.cs +++ b/src/Api/Controllers/AccountsController.cs @@ -170,10 +170,17 @@ namespace Bit.Api.Controllers } [HttpGet("revision-date")] - public async Task GetAccountRevisionDate() + public async Task GetAccountRevisionDate() { var userId = _userService.GetProperUserId(User); - return userId.HasValue ? (await _userService.GetAccountRevisionDateByIdAsync(userId.Value)) : (DateTime?)null; + long? revisionDate = null; + if(userId.HasValue) + { + var date = await _userService.GetAccountRevisionDateByIdAsync(userId.Value); + revisionDate = Core.Utilities.CoreHelpers.EpocMilliseconds(date); + } + + return revisionDate; } [HttpGet("two-factor")] diff --git a/src/Core/Utilities/CoreHelpers.cs b/src/Core/Utilities/CoreHelpers.cs index b3317c74d..56bed884f 100644 --- a/src/Core/Utilities/CoreHelpers.cs +++ b/src/Core/Utilities/CoreHelpers.cs @@ -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); /// /// 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); + } } }