Get started with dates, times, and time zones

Beginner
Developer
Student
.NET

In this module, you learn how to handle date and time effectively in C# applications that focus on scheduling meetings and logging events across different time zones.

Learning objectives

  • Use DateOnly, TimeOnly, and DateTime classes to represent dates and times.

  • Perform time zone conversions and interval calculations using DateTimeOffset, TimeZoneInfo, and TimeSpan.

  • Retrieve and manipulate day of the week information using DayOfWeek.

  • Handle culture-specific data using CultureInfo.

  • Perform calendar-related operations using Calendar and define rules for determining the first week of the year using CalendarWeekRule.

Prerequisites

  • Visual Studio Code installed with the C# Dev Kit.

  • Basic knowledge of the Visual Studio Code IDE.

  • Basic understanding of the C# programming language.

  • Familiar with classes, abstract classes, interfaces and inheritance.