1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 13:38:13 -05:00

tz id for linux vs windows

This commit is contained in:
Kyle Spearrin 2019-07-10 22:16:24 -04:00
parent b5d2a1da75
commit d61957d2de

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Web;
@ -165,8 +166,10 @@ namespace Bit.Billing.Utilities
CultureInfo.InvariantCulture, DateTimeStyles.None, out var paymentDate);
if(parsed)
{
return TimeZoneInfo.ConvertTimeToUtc(paymentDate,
TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"));
var pacificTime = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time") :
TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
return TimeZoneInfo.ConvertTimeToUtc(paymentDate, pacificTime);
}
}
return default(DateTime);