UTC - 5 hours = EST: Central Standard Time (CST) UTC - 6 hours = CST: Mountain Standard Time (MST) UTC - 7 hours = MST: Pacific Standard Time (PST) UTC - 8 hours = PST. I'm converting the UTC time, taken from my local Server time to Central standard time. I have this running on a server in Germany. Converting the time and date works, but when a library i have converts it to a string it has a wrong Timezone offset. It comes out as 2019-05-11T14:44:09+02:00 when i need it to be 2019-05-11T14:44:09-06:00.
-->Definition
Converts a Coordinated Universal Time (UTC) to the time in a specified time zone.
Parameters
- dateTime
- DateTime
The Coordinated Universal Time (UTC).
- destinationTimeZone
- TimeZoneInfo
The time zone to convert
dateTime
to.Returns
- DateTime
The date and time in the destination time zone. Its Kind property is Utc if
destinationTimeZone
is Utc; otherwise, its Kind property is Unspecified.Exceptions
The Kind property of
dateTime
is Local.destinationTimeZone
is null
.Examples
The following example converts Coordinated Universal Time (UTC) to Central Time. Amazon first office photo.
Utc To Central Daylight Time Converter
Remarks
Utc 1500 To Cst
When performing the conversion, the ConvertTimeFromUtc method applies any adjustment rules in effect in the
destinationTimeZone
time zone.Utc To Central Us
The precise behavior of this method depends on the value of the Kind property of the
dateTime
parameter, as the following table shows.DateTime.Kind property | Conversion |
---|---|
DateTimeKind.Local | Throws an ArgumentException. |
DateTimeKind.Unspecified or DateTimeKind.Utc | Converts from Coordinated Universal Time (UTC). |
If the conversion of
dateTime
results in a date and time value that is earlier than DateTime.MinValue or later than DateTime.MaxValue, this method returns DateTime.MinValue or DateTime.MaxValue, respectively.