Using Dates

The DateTime structure in the .NET Compact Framework implements dates. A DateTime structure holds date values accurate to one tick (100 nanoseconds). Dates are held relative to a start date of 12:00 midnight, January 1, 1 A.D. (also known as C.E. or Common Era). Dates are immutable, which means that any operations to modify a date will actually return a new instance of a date. This has performance implications when performing many date operations.

DateTime objects hold absolute date and time values. A TimeSpan object, frequently used with dates, holds a relative time or a time interval. The date arithmetic code examples in the following subsections examine the use of TimeSpan objects. The DateTime and TimeSpan structures are defined ...

Get Microsoft® .NET Compact Framework (Core Reference) 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.