Skip to content

Commit 177ed96

Browse files
committed
Backport of #4
🐛 Delay calculation was incorrectly converting using the system timezone. Now using the configured timezone.
1 parent c09eae9 commit 177ed96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/CronTimer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ TimeSpan CalculateDelay()
5959
TimeSpan delay;
6060
if (tz != UTC)
6161
{
62-
delay = Next.ToUniversalTime() - nowUtc;
62+
var nextUtc = TimeZoneInfo.ConvertTimeToUtc(Next, tzi);
63+
delay = nextUtc - nowUtc;
6364
}
6465
else
6566
{

0 commit comments

Comments
 (0)