Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created November 2, 2022 17:46
Show Gist options
  • Save jskeet/62cd55dbaa421eb4e9b1a59fa9fa5d78 to your computer and use it in GitHub Desktop.
Save jskeet/62cd55dbaa421eb4e9b1a59fa9fa5d78 to your computer and use it in GitHub Desktop.
using System;
using System.Globalization;
class Program
{
static void Main()
{
var zone = TimeZoneInfo.FindSystemTimeZoneById("Altai Standard Time");
DateTime start = new DateTime(2013, 12, 31, 16, 0, 0, DateTimeKind.Utc);
DateTime end = start.AddHours(4);
for (DateTime current = start; current < end; current = current.AddMinutes(10))
{
Console.WriteLine($"{current:yyyy-MM-dd'T'HH':'mm':'ss'Z'}: {zone.GetUtcOffset(current)}");
}
}
}
@jskeet
Copy link
Author

jskeet commented Nov 2, 2022

Output:

2013-12-31T16:00:00Z: 07:00:00
2013-12-31T16:10:00Z: 07:00:00
2013-12-31T16:20:00Z: 07:00:00
2013-12-31T16:30:00Z: 07:00:00
2013-12-31T16:40:00Z: 07:00:00
2013-12-31T16:50:00Z: 07:00:00
2013-12-31T17:00:00Z: 06:00:00
2013-12-31T17:10:00Z: 06:00:00
2013-12-31T17:20:00Z: 06:00:00
2013-12-31T17:30:00Z: 06:00:00
2013-12-31T17:40:00Z: 06:00:00
2013-12-31T17:50:00Z: 06:00:00
2013-12-31T18:00:00Z: 07:00:00
2013-12-31T18:10:00Z: 07:00:00
2013-12-31T18:20:00Z: 07:00:00
2013-12-31T18:30:00Z: 07:00:00
2013-12-31T18:40:00Z: 07:00:00
2013-12-31T18:50:00Z: 07:00:00
2013-12-31T19:00:00Z: 07:00:00
2013-12-31T19:10:00Z: 07:00:00
2013-12-31T19:20:00Z: 07:00:00
2013-12-31T19:30:00Z: 07:00:00
2013-12-31T19:40:00Z: 07:00:00
2013-12-31T19:50:00Z: 07:00:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment