System.DateTime.Now Property

Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.

Syntax

public static DateTime Now { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The resolution of this property depends on the system timer.

Windows NT 3.5 and later

10 milliseconds

Windows 98

55 milliseconds

The DateTime.Now property is frequently used to measure performance. However, because of its low resolution, it is not suitable for use as a benchmarking tool. A better alternative is to use the System.Diagnostics.Stopwatch class.

Starting with the .NET Framework version 2.0, the return value is a DateTime whose DateTime.Kind property returns DateTimeKind.Local.

Note:

You can also use the DateTimeOffset.Now property to retrieve the current local date and time. It allows a local time to be expressed unambiguously as a single point in time, which in turn makes that time value portable across computers.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0