From d52806952e67ce2167c418388500c97d2e65640b Mon Sep 17 00:00:00 2001 From: axunonb Date: Wed, 2 Oct 2024 09:04:46 +0200 Subject: [PATCH] Make TimeZoneConverter.ToUtc(DateTime, string) static --- Axuno.Tools.Tests/DateAndTime/TimeZoneConverterTests.cs | 2 +- Axuno.Tools/DateAndTime/TimeZoneConverter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Axuno.Tools.Tests/DateAndTime/TimeZoneConverterTests.cs b/Axuno.Tools.Tests/DateAndTime/TimeZoneConverterTests.cs index e388945..6e4f01d 100644 --- a/Axuno.Tools.Tests/DateAndTime/TimeZoneConverterTests.cs +++ b/Axuno.Tools.Tests/DateAndTime/TimeZoneConverterTests.cs @@ -186,7 +186,7 @@ public void ConvertTimeZoneToUtc_ShouldReturnNull_WhenDateTimeOfAnyKindIsNull() DateTime? dateTimeOfAnyKind = null; // Act - var convertedDateTime = GetTimeZoneConverter("en-US").ToUtc(dateTimeOfAnyKind, "Europe/Berlin"); + var convertedDateTime = Axuno.Tools.DateAndTime.TimeZoneConverter.ToUtc(dateTimeOfAnyKind, "Europe/Berlin"); // Assert Assert.That(convertedDateTime, Is.Null); diff --git a/Axuno.Tools/DateAndTime/TimeZoneConverter.cs b/Axuno.Tools/DateAndTime/TimeZoneConverter.cs index 251df0f..37f840c 100644 --- a/Axuno.Tools/DateAndTime/TimeZoneConverter.cs +++ b/Axuno.Tools/DateAndTime/TimeZoneConverter.cs @@ -71,7 +71,7 @@ public DateTime ToUtc(DateTime zoneDateTime) return ToUtc(zoneDateTime, _ianaTimeZoneId); } - public DateTime? ToUtc(DateTime? zoneDateTime, string timeZoneId) + public static DateTime? ToUtc(DateTime? zoneDateTime, string timeZoneId) { if (!zoneDateTime.HasValue) return null;