Skip to content

Commit

Permalink
Made timezone conversion cross-platform
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpainter committed Feb 18, 2021
1 parent cb36290 commit 2d2cd8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Sanchez.Processing/Sanchez.Processing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="TimeZoneConverter" Version="3.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Text.RegularExpressions;
using TimeZoneConverter;

namespace Sanchez.Processing.Services.Filesystem.Parsers
{
Expand All @@ -11,7 +12,7 @@ public class ElectroFilenameParser : AbstractFilenameParser
{
protected override Regex Regex { get; }
protected override string TimestampFormat => "yyMMdd_HHmm";
protected override TimeZoneInfo TimeZone => TimeZoneInfo.FindSystemTimeZoneById("Russian Standard Time");
protected override TimeZoneInfo TimeZone => TZConvert.GetTimeZoneInfo("Russian Standard Time");

public ElectroFilenameParser(string? prefix, string? suffix)
{
Expand Down

0 comments on commit 2d2cd8a

Please sign in to comment.