[]
Converts the value of the local time to UTC time. Note that there may be different possible interpretations at the daylight time boundaries.
public DateTime ToUniversalTime(DateTime dateTime)
Public Function ToUniversalTime(dateTime As Date) As Date
| Type | Name | Description |
|---|---|---|
| DateTime | dateTime | The local time to convert. |
| Type | Description |
|---|---|
| DateTime | The UTC DateTime. |
| Type | Condition |
|---|---|
| ArgumentException | dateTime.Kind is Utc and current time zone does not equal Utc -or- dateTime.Kind is Local and current time zone does not equal Local -or- dateTime value represents invalid time. |