5.3. Date and time support

The .NET Framework class library provides extensive support for dates and times by means of the following structures.

  • System.DateTime Structure Used to represent a date and time of day.

  • System.TimeSpan Structure Used to represent arbitrary time spans.

  • System.TimeZone Structure Provides support for multiple time zones and includes support for daylight saving time.

In the following sections we will look at these structures in more detail.

DateTime structure

This structure (value type) can be used to represent a date and time of day. It contains a number of methods to work with DateTime values. The DateTime represents dates and times that range between MinValue and MaxValue constants. The MinValue constant is 00:00:00 ...

Get A Programmer's Guide to .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.