O'Reilly logo

Introducing Visual C# 2010 by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. Time & Dates

Working with times and dates is a common task. You may want to check if a file has changed since last you looked, test how long an operation takes to complete, or work out some kind of schedule for future activities. C# and the .NET Framework Class Library have extensive support for measuring and managing time and dates. This chapter starts with support for measuring small amounts of time very accurately and moves on to the mainstays of time representation, the System.TimeSpan and System.DateTime structures. Table 22-1 provides the summary for this chapter.

Table 22-1. Quick Problem/Solution Reference for Chapter 22

Problem

Solution

Listings

Measure how long an activity takes.

Use the StopWatch class.

22-1, 22-2

Represent a period ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required