ConvertTime()

TimeZoneInfo::ConvertTime(DateTime, const TimeZoneInfoPtr&, const TimeZoneInfoPtr&) method

Convert time from one time zone to another.

static DateTime System::TimeZoneInfo::ConvertTime(DateTime date_time, const TimeZoneInfoPtr &source_time_zone, const TimeZoneInfoPtr &destination_time_zone)

Arguments

ParameterTypeDescription
date_timeDateTimeDate and time to convert.
source_time_zoneconst TimeZoneInfoPtr&Source time zone.
destination_time_zoneconst TimeZoneInfoPtr&Destination time zone.

Return Value

Converted date and time.

TimeZoneInfo::ConvertTime(const DateTimeOffset&, const TimeZoneInfoPtr&) method

Convert time to the time in a specified time zone.

static DateTimeOffset System::TimeZoneInfo::ConvertTime(const DateTimeOffset &date_time_offset, const TimeZoneInfoPtr &destination_time_zone)

Arguments

ParameterTypeDescription
date_time_offsetconst DateTimeOffset&Date and time to convert.
destination_time_zoneconst TimeZoneInfoPtr&Destination time zone.

Return Value

Converted date and time.

TimeZoneInfo::ConvertTime(DateTime, const TimeZoneInfoPtr&) method

Convert time to the time in a specified time zone.

static DateTime System::TimeZoneInfo::ConvertTime(DateTime date_time, const TimeZoneInfoPtr &destination_time_zone)

Arguments

ParameterTypeDescription
date_timeDateTimeDate and time to convert.
destination_time_zoneconst TimeZoneInfoPtr&Destination time zone.

Return Value

Converted date and time.

See Also