AITeky Learn

AiTeky Original Interactive Learning & Practice Intermediate

C# and .NET dates: store UTC, daylight saving and the job that ran twice

See why the same moment is a different date in different time zones, how daylight saving makes a local time vanish or happen twice, and fix a nightly job that ran twice on one day and not at all on another.

Dates look simple until the clock changes. A moment in time has one UTC value but a different local time in each time zone, and in zones that use daylight saving, a local time can be skipped in spring and repeated in autumn. Code that stores or schedules by local time then misbehaves exactly twice a year, usually at 3 a.m. when nobody is watching.

This course models dates and clock changes with small Python programs you can run in your browser. Python's datetime stands in for .NET's DateTime and DateTimeOffset: the code is not C#, but the rules it shows are the same. Check the .NET documentation for DateTimeOffset, TimeZoneInfo and DateTimeKind. The time zone and its change dates are made up.

  • Learn lessons explain one idea at a time and let you run it.
  • Industry ready lessons decide and justify, and end with interview questions.

No C# experience is assumed. Basic Python helps.

Locked. Sign up free

Learn

Understand each idea with everyday examples. No coding background needed.

  1. 01 25 min Free sample 🔒 AiTeky Pass One moment, many dates Show how one instant falls on different calendar dates in different zones, and why you should store UTC and convert only for display.
  2. 02 25 min 🔒 AiTeky Pass The hour that vanishes and repeats Walk across a spring and an autumn clock change in a made-up zone and see a local time that does not exist on one day and happens twice on another.

Industry ready

Real problems from real jobs, and the questions interviewers ask about them.

  1. 03 30 min 🔒 AiTeky Pass On the job: the billing job that ran twice A nightly billing run charged customers twice on one date and skipped another. Trace it to the clock change, compare four fixes by effort and risk, choose, and write the note.

We use essential cookies to run the site. With your permission we also set one anonymous ID to count unique visitors, and analytics cookies to see which pages help learners. Cookie notice

Join AiTeky Learn. It's free.

Create a free account to track your progress, save items for later and get study suggestions.

Sign up free Log in