Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the Coordinated Universal Time (UTC) that corresponds to a specified time.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Overridable Function ToUniversalTime ( _
time As DateTime _
) As DateTime
public virtual DateTime ToUniversalTime(
DateTime time
)
public:
virtual DateTime ToUniversalTime(
DateTime time
)
abstract ToUniversalTime :
time:DateTime -> DateTime
override ToUniversalTime :
time:DateTime -> DateTime
public function ToUniversalTime(
time : DateTime
) : DateTime
Parameters
- time
Type: System. . :: . .DateTime
A date and time.
Return Value
Type: System. . :: . .DateTime
A DateTime object whose value is the Coordinated Universal Time (UTC) that corresponds to time.
Remarks
If the local time zone observes daylight saving time, ToUniversalTime applies the current adjustment rule to the time parameter when performing the conversion.
If the time parameter is an ambiguous time, the method assumes that it is a standard time. (An ambiguous time is one that can map either to a standard time or to a daylight saving time in the local time zone.) If time is an invalid time, the method simply subtracts the local time from the local time zone's UTC offset to return UTC. (An invalid time is one that does not exist because of the application of daylight saving time adjustment rules.)
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.