DateTimeUtil.ToUniversalTime Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ToUniversalTime(DateTime) |
Converts the specified DateTime to UTC if it is not already in UTC. |
ToUniversalTime(Nullable<DateTime>) |
Converts the specified DateTime to UTC if it is not already in UTC. |
ToUniversalTime(DateTime)
Converts the specified DateTime to UTC if it is not already in UTC.
public static DateTime ToUniversalTime (DateTime value);
static member ToUniversalTime : DateTime -> DateTime
Public Shared Function ToUniversalTime (value As DateTime) As DateTime
Parameters
Returns
The converted DateTime in UTC.
Applies to
ToUniversalTime(Nullable<DateTime>)
Converts the specified DateTime to UTC if it is not already in UTC.
public static DateTime? ToUniversalTime (DateTime? value);
static member ToUniversalTime : Nullable<DateTime> -> Nullable<DateTime>
Public Shared Function ToUniversalTime (value As Nullable(Of DateTime)) As Nullable(Of DateTime)
Parameters
Returns
The converted DateTime in UTC, or null if value
is null.