
Explore date and time fundamentals in .NET and SQL Server, including UTC, GMT, time zones and DST, NTP and epoch time, DateTime and DateTimeOffset, TimeZoneInfo, and Noda Time.
Explore how dates and times drive every schedule and why their quirks cause bugs, from leap day to clocks in devices, with real-world failures and lessons.
Explore how human factors and local time notions complicate date and time handling, from Julius and Gregorian calendars to leap seconds, UTC, NTP synchronization, and Mars day.
Explore how computers store and measure time, from seconds to 100-nanosecond ticks in .NET DateTime, and how operating systems synchronize with UTC using NTP.
Explore how atomic time underpins modern timekeeping through cesium-133 transitions and atomic clocks, forming the international time scale TAI. In the next lecture, you’ll learn what are UTC and GMT.
Explore how UTC serves as the modern civil time standard, its relation to TAI and leap seconds, and how GMT compares and is largely superseded.
Define time zones and explain they are based on UTC with an offset; see Moscow UTC+03 and Bolivia UTC-03, and learn that UTC is marked by 'Z' or Zulu.
Master how to standardize date and time using ISO-8601 across XML and JSON, cover time formats, offsets, and RFC 3339 and RFC 822/1123 conventions.
Explore epoch time and Unix time, clarifying their difference and starting point. Learn how Unix time counts seconds since the Unix epoch and why conversion is needed for end users.
Explore how date and time values fit into different scopes, from combined date-time and date-only to time of day and elapsed time, using DateTime and TimeSpan to prevent common bugs.
Understand how date time values carry perspective—unspecified, local, or UTC—and how floating times differ across time zones, with best practices for local perspective using offset and zone name.
Explore date-time fundamentals in .NET and SQL Server, including UTC, GMT, ISO-8601, Unix time, time zones, and the global and local perspectives that shape reliable time handling.
Discover daylight saving time and time zone concepts within date and time fundamentals. Explore time zone definitions and fallacies that cause subtle bugs, with IANA and Microsoft as providers.
Explain daylight saving time, including spring forward and fall back transitions. Show how clock shifts create gaps, overlaps, and UTC offsets.
Define a time zone as a geographic region with the same local time and rules, including standard offsets and daylight-saving transitions, noting historic changes and need for time zone databases.
Explore the IANA time zone database, its Olson tzdb formats, region/local zone naming, and transition rules, and learn its cross-platform support and limitations in .NET and Windows environments.
Learn about the Microsoft time zone database, its Windows integration and TimeZoneInfo wrapper, its odd names and limited history, and how CLDR maps IANA to Windows time zones.
Understand how governments regulate daylight saving and standard time, how transitions create gaps or overlaps, and how the IANA database and .NET TimeZoneInfo relate to the Win32 API.
Explore the key date and time types in the .NET BCL, including DateTime, DateTimeOffset, TimeZoneInfo, TimeSpan, Calendar, Stopwatch, and common traps, with practical guidance.
Explore the DateTime structure, its range and tick-level precision, and how DateTimeKind Unspecified, Local, and UTC affect conversions, with practical cautions about serialization and time zone handling.
Explore how .NET handles date and time with a Moscow example, demonstrating UTC vs local conversions, duplicating 01:30 around DST, and the limitations of DateTime for offsets compared to DateTimeOffset.
Explore how DateTimeOffset handles value ranges, offsets, and perspectives, including local, unspecified, and UTC forms, and why TimeZoneInfo and Noda Time matter for historical data.
Learn how TimeZoneInfo works with the Microsoft time zone database, not the IANA database, converts UTC to any time zone, and preserves offsets with DateTimeOffset.
TimeSpan represents elapsed time with a wide range and 100 nanosecond precision, and factory methods like FromSeconds or FromMilliseconds offer readable APIs over constructors.
Explore the calendar hierarchy from the Calendar base class to GregorianCalendar, and see how culture info and Hebrew or non-gregorian calendars affect parsing, formatting, and date limits.
Explain the stopwatch class for high-precision time measuring, compare Environment.TickCount and DateTime.UtcNow.Ticks with Stopwatch, and show Stopwatch achieves about 300–400 nanoseconds precision on Windows.
Examine the limitations of the BCL date time types, including DateTime and DateTimeOffset, and how UTC and local perspective affect accuracy. See why NodaTime and Quartz improve reliability and scheduling.
Discover the Noda Time library for .NET, a powerful API that handles date and time safely, supports IANA and Microsoft time zones, and enables separate date and time types.
Explore core time types, from Duration to Instant. See how Period and Interval model elapsed time, date ranges, and time zones with calendar and zone APIs.
Replace unstable time dependencies with Noda Time in unit tests by injecting IClock. Use system or zoned clocks and Noda Time testing doubles to stabilize logic with Instant and GetCurrentInstant.
Recap the key Noda Time concepts and core types, including duration, period, instant, interval, local and zoned date-time, and the IClock testing approach.
Discover the six core date and time types in SQL Server—date, time, smalldatetime, datetime, datetime2, and datetimeoffset—alongside functions to process them and guidance on time zones.
Master the SQL Server DATE type, its date-only scope, and ISO 8601 formats. Learn safe initialization with DATEFROMPARTS and other date-time functions to avoid ambiguity.
Learn how the time type represents time of day, with hh:mm:ss.sssssss formats, 0–7 precision, and memory options; initialize with strings or timefromparts, and perform operations via cast, dateadd, and datediff.
Explore smalldatetime, datetime, and datetime2, their epoch baseline at 1900-01-01, precision and rounding, and why Microsoft recommends dateadd, datediff, and using datetime2 over older types.
Explore date and time functions in SQL Server, including dateadd, datediff, eomonth, current time functions, and cast versus convert for data type conversions.
Datetimeoffset stores only an offset, not a time zone, with seven-decimal precision and a wide date range. Learn UTC to local conversions using at time zone, SwitchOffset, and ConvertZone.
Explore date and time handling in SQL Server, including date, time, datetime2, and datetimeoffset for time zones; avoid string literals and prepare for best practices in the next section.
Explore the quirks of date arithmetic, robust datetime parsing, birthday calculations, scheduling pitfalls, and best practices for formatting and range handling in .NET and SQL Server.
Master date arithmetic in .net with AddYears and AddMilliseconds; learn how DateTime and DateTimeOffset mishandle transitions and why UTC conversion is needed.
Examine how parsing date and time across cultures affects results, compare Parse, ParseExact, and DateTimeOffset with DateTimeStyles.RoundtripKind, and preserve time zone information using ISO formats.
Convert UTC to the target time zone, compute the age by year difference, and adjust for whether the birthday occurred; cover leap year, Feb 29, and east asian age rules.
Explore scheduling events across local and UTC perspectives, including storing time zone identifiers and repeat patterns, while handling daylight saving transitions with possible duplicates or gaps.
Discover best practices for date formats in .NET and SQL Server by avoiding hardcoded dates, using named parameters, carrying the format with the value, or adopting the ISO format YYYY-MM-DD.
Explore how date and time ranges behave as half-open intervals for time values and as closed intervals for dates, and learn how to calculate durations, check containment, and assess overlaps.
Preserve perspective to avoid bugs in roundtrip conversions by parsing with DateTimeStyles.RoundtripKind and recovering with DateTime.SpecifyKind(DateTimeKind.UTC), and rely on DateTime.UtcNow or DateTimeOffset with Stopwatch for precise timing, especially on servers.
Learn to avoid common pitfalls in date and time handling in .NET and SQL Server by mastering parsing, TryParseExact, time zones, 29th February corner case, and precise measurements with Stopwatch.
Explore date and time fundamentals in .NET and SQL Server, and engage with the course finale by accessing discounts, leaving reviews, and visiting the instructor's blog, mailing list, and Patreon.
Teaching Approach
No fluff, no ranting, no beating the air. I esteem your time. The course material is succinct, yet comprehensive. All the important concepts are covered. Particularly important topics are covered in-depth. For absolute beginners, I offer my help on Skype absolutely free, if requested.
Take this course, and you will be satisfied.
Build a solid foundation of working with Date and Time with this course
Almost all the software works with date and time in one form or another. Some programs, of course, need to work with date and time more than other. However, date and time hide many pitfalls even in very simple scenarios. We all know that security and logging are regular aspects of almost any program. There is a wise phrase that sounds like: “Developers recall about security when it is too late.” The same can be said about date and time. Most developers don’t even imagine how many bugs are hiding behind the simple face of date and time. Those bugs are sitting in programs and waiting for their moment to blow up your production code causing very unfortunate repercussions. That’s why working with date and time is the full-fledged and very important aspect of software development.
Have you watched magnificent enlightening TV Shows by BBC? This course in some parts is like those BBC shows, because you’ll learn many interesting surprising facts. Besides, being familiar with peculiarities of working with date and time, you can write much more reliable and maintainable applications.
Content and Overview
This course is aimed at all kind of developers. It provides solid theoretical base reinforced by practical material.
We start with basics of date and time. I’ll show you some real cases when bugs related to date and time caused unpleasant consequences, event deaths of people. You’ll learn why the hell Gregorian calendar was introduced, why the 5th of October 1582 doesn’t exist at all. And did you know that actually a minute can last more than 60 seconds? Yes, you heard that, a minute can last more than 60 seconds. You’ll learn what is UTC, GMT, what is the difference between them and how time gets synchronized between computers all over the world. And by the way, what is time at all, how humanity measures it? After that, you’ll be introduced to the concept of time zones, you’ll learn about different standards that regulate date and time formatting. You’ll learn what is Epoch Time and Unix Time. Finally, you’ll understand the difference between different date-time scopes and perspectives.
The next section is dedicated to Time Zones where you’ll learn about daylight saving time and different very odd case with time transitions back and forth. I’ll give you a full definition of a time zone. You’ll learn more about providers of time zone information: IANA and Microsoft. You’ll learn many interesting facts and what fallacies exist about time zones.
The third section is all about date and time related types from BCL in .NET. You’ll learn about DateTime, DateTimeOffset, TimeZoneInfo, TimeSpan, Calendars and Stopwatch. I’ll show you that DateTime hides many pitfalls. You’ll learn that actual precision of BCL types is not equal to 100 nanoseconds as declared in the documentation. You’ll see how many calendars exist and what we can do with them. The third section reveals all the problems with the types built-in to BCL, so in the next section, you’ll learn about a third-party library called “Noda Time”.
Yes, a whole section is dedicated to the Noda Time library. You’ll learn about features provided by this library. You’ll get an overview of all the core types such as: LocalTime, LocalDate, LocalDateTime, Instant, Interval, Duration, ZonedDateTime and others. You’ll also learn how to write unit tests on code which uses date and time values with the help of Noda Time.
The whole section is dedicated to best practices of working with date and time. You’ll see some astonishing things like arithmetic on dates and problems of birthday calculation. You’ll learn the problems related to parsing and how to overcome them. I’ll show you the problems of events scheduling and what to do to avoid common mistakes. You’ll learn about date and time ranges, “intervals” is a separate peculiar topic. I’ll also show some additional best practices.
In other words, an exciting journey is waiting for you, just take it, relax and enjoy.
So, in short, the course covers the following topics:
In the end, we will recap what you have learned.
How long is this course: The course is around 3 hours. All are video lectures. You will be able to download all the slides and code samples used in the course.
Keywords.