1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

America/New_York timezone on non-windows

This commit is contained in:
Kyle Spearrin
2019-08-27 23:30:53 -04:00
parent 9c90358aa1
commit c31e377f32
2 changed files with 23 additions and 4 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Bit.Core;
@ -26,8 +27,13 @@ namespace Bit.Admin.Jobs
public override async Task StartAsync(CancellationToken cancellationToken)
{
var timeZone = _globalSettings.SelfHosted ? TimeZoneInfo.Utc :
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
var timeZone = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time") :
TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
if(_globalSettings.SelfHosted)
{
timeZone = TimeZoneInfo.Utc;
}
var everyTopOfTheHourTrigger = TriggerBuilder.Create()
.StartNow()