DateTimeExtensionsConvert Method |
Converts a date from one
TimeZone to another. If either
TimeZone is null
the date/time is not converted. Note that converting time-only values is generally not recommended as
daylight savings time cannot be properly handled and because proper conversion may change the date as
well as the time.
Namespace:
NetQuarry
Assembly:
EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax public static DateTime Convert(
this DateTime dt,
TimeZone source,
TimeZone destination
)
<ExtensionAttribute>
Public Shared Function Convert (
dt As DateTime,
source As TimeZone,
destination As TimeZone
) As DateTime
Parameters
- dt
- Type: SystemDateTime
The date/time to convert. - source
- Type: NetQuarryTimeZone
The TimeZone of the unconverted date/time. - destination
- Type: NetQuarryTimeZone
The TimeZone to which to convert.
Return Value
Type:
DateTimeThe date/time converted to the destination TimeZone.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also