# GrapeCity.ActiveReports.Core.Rendering.JpCalendar.JapaneseCalendarEx.AddYears

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Core_Rendering_JpCalendar_JapaneseCalendarEx_AddYears_" data-uid="GrapeCity.ActiveReports.Core.Rendering.JpCalendar.JapaneseCalendarEx.AddYears*">AddYears Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Core_Rendering_JpCalendar_JapaneseCalendarEx_AddYears_" data-uid="GrapeCity.ActiveReports.Core.Rendering.JpCalendar.JapaneseCalendarEx.AddYears*"></a>
<h4 id="GrapeCity_ActiveReports_Core_Rendering_JpCalendar_JapaneseCalendarEx_AddYears_System_DateTime_System_Int32_" data-uid="GrapeCity.ActiveReports.Core.Rendering.JpCalendar.JapaneseCalendarEx.AddYears(System.DateTime,System.Int32)">AddYears(DateTime, int)</h4>
<div class="markdown level1 summary"><p>Returns a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a> that is the specified number of years away from
the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public override DateTime AddYears(DateTime time, int years)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a></td>
      <td><span class="parametername">time</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a> to which to add years.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">years</span></td>
      <td><p>The number of years to add.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a> that results from adding the specified number of years to
the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.calendar.addyears">Calendar.AddYears(DateTime, int)</a></div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p>time is outside the supported range of the <span class="xref">JapaneseCalendarEx</span> type.
-or-years is less than -10,000 or greater than 10,000.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>The resulting <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a> is outside the supported range.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
