asp.net.ph

DateTime.UtcNow Property

System Namespace   DateTime Structure


Returns a DateTime that is the current local date and time on this computer expressed as the coordinated universal time ( UTC ).

[ VB ]
<Serializable>
Public Shared ReadOnly Property UtcNow As DateTime

[ C# ]
[ Serializable ]
public static DateTime UtcNow { get; }

[ C++ ]
[ Serializable ]
public: __property static DateTime get_UtcNow ( );

[ JScript ]
public Serializable
static function get UtcNow ( ) : DateTime;

Property Value

A DateTime whose value is the current UTC date and time.

Remarks

The resolution of this property depends on the system timer.

System Approximate Resolution
Windows NT 3.5 and later 10 milliseconds
Windows NT 3.1 16 milliseconds
Windows 98 55 milliseconds

NOTE: DateTime.UtcNow returns the same value as invoking TimeZone.CurrentTimeZone.ToUniversalTime ( DateTime.Now ).

Example

The following example gets the value returned by UtcNow on the server to determine the current local time of a user's browser based on the time zone offset obtained from the client as the page loads.

Localization Resource Fallback
Run Sample | View Source
See Also

DateTime Members   GetUtcOffset Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph