GLib.DateTime.prototype.add_years

function add_years(years: Number(gint)): GLib.DateTime {
    // Gjs wrapper for g_date_time_add_years()
}
  

Creates a copy of datetime and adds the specified number of years to the copy. Add negative values to subtract years.

Since 2.26

years

the number of years

Returns

the newly created GLib.DateTime which should be freed with GLib.DateTime.prototype.unref.