mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-10 20:02:31 +00:00
15 lines
472 B
C#
15 lines
472 B
C#
using System;
|
|
using ReflectionMagic;
|
|
|
|
namespace DiscordChatExporter.Cli.Tests.Utils;
|
|
|
|
internal static class TimeZoneInfoEx
|
|
{
|
|
// https://stackoverflow.com/a/63700512/2205454
|
|
public static void SetLocal(TimeZoneInfo timeZone) =>
|
|
typeof(TimeZoneInfo).AsDynamicType().s_cachedData._localTimeZone = timeZone;
|
|
|
|
public static void SetLocal(TimeSpan offset) =>
|
|
SetLocal(TimeZoneInfo.CreateCustomTimeZone("test-tz", offset, "test-tz", "test-tz"));
|
|
}
|