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

◆ create_floating_date_rule()

static transition_time xtd::time_zone_info::transition_time::create_floating_date_rule ( date_time  time_of_day,
uint32  month,
uint32  week,
xtd::day_of_week  day_of_week 
)
static

Defines a time change that uses a floating-date rule (that is, a time change that occurs on a specific day of a specific week of a specific month).

Parameters
time_of_dayThe time at which the time change occurs. This parameter corresponds to the xtd::time_zone_info::transition_time::ttime_of_day property.
monthThe month in which the time change occurs. This parameter corresponds to the xtd::time_zone_info::transition_time::month property.
weekThe week of the month in which the time change occurs. Its value can range from 1 to 5, with 5 representing the last week of the month. This parameter corresponds to the xtd::time_zone_info::transition_time::week property
day_of_weekThe day of the week on which the time change occurs. This parameter corresponds to the xtd::time_zone_info::transition_time::day_of_week property.
Returns
Data about the time change.
Exceptions
xtd::argument_exceptionThe time_of_day parameter has a non-default date component.
-or-
The time_of_day parameter's Kind property is not unspecified.
-or-
The time_of_day parameter does not represent a whole number of milliseconds.
xtd::argument_out_of_range_exceptionThe month parameter is less than 1 or greater than 12.
-or-
The week parameter is less than 1 or greater than 5.
Remarks
This method creates a floating-date rule (that is, a time change that occurs on a specific day of a specific week of a specific month). For example, a time change that occurs on the last Sunday of October follows a floating-date rule.
For transitions from standard time to daylight saving time, the time_of_day argument represents the time of the transition in the time zone's standard time. For transitions from daylight saving time to standard time, it represents the time of the transition in the time zone's daylight saving time. Note that this is a xtd::date_time value whose year, month, and date values must all equal 1.