xtd 0.2.0
Loading...
Searching...
No Matches

◆ convert_time() [2/2]

static xtd::date_time xtd::time_zone_info::convert_time ( const xtd::date_time date_time,
const xtd::time_zone_info source_time_zone,
const xtd::time_zone_info destination_time_zone 
)
static

Converts a time from one time zone to another.

Parameters
date_timeThe date and time to convert.
source_time_zoneThe time zone of date_time.
destination_time_zoneThe time zone to convert date_time to.
Returns
The date and time in the destination time zone that corresponds to the dateTime parameter in the source time zone.
Exceptions
xtd::argument_exceptionThe xtd::date_time::kind property of the date_time parameter is xtd::date_time_kind::local, but the source_time_tone parameter does not equal xtd::date_time_kind::local.
-or-
The xtd::date_time::kind property of the date_time parameter is xtd::date_time_kind::utc, but the source_time_zone parameter does not equal xtd::date_time_kind::utc.
-or-
The date_time parameter is an invalid time (that is, it represents a time that does not exist because of a time zone's adjustment rules).