Returns a new xtd::date_time that adds the specified number of years to the value of this instance.
- Parameters
-
value | A number of years. The value parameter can be negative or positive. |
- Returns
- An object whose value is the sum of the date and time represented by this instance and the number of years represented by value.
- Exceptions
-
- Examples
- The following example illustrates using the xtd::date_time::add_years method with a xtd::date_time value that represents a leap year day. It displays the date for the fifteen years prior to and the fifteen years that follow February 29, 2000.
- Examples
- date_time_day_of_year.cpp.