# FarPoint.Web.Spread.DateTimeCellType.Format

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Web_Spread_DateTimeCellType_Format_" data-uid="FarPoint.Web.Spread.DateTimeCellType.Format*">Format Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Web_Spread_DateTimeCellType_Format_" data-uid="FarPoint.Web.Spread.DateTimeCellType.Format*"></a>
<h4 id="FarPoint_Web_Spread_DateTimeCellType_Format_System_Object_" data-uid="FarPoint.Web.Spread.DateTimeCellType.Format(System.Object)">Format(object)</h4>
<div class="markdown level1 summary"><p>When deriving a cell type based on this type, override this<br>
to change what gets passed back and formatted as a string
into the cell on the sheet from the object in the data model.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public override string Format(object obj)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overrides Function Format(obj As Object) As String</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.object">object</a></td>
      <td><span class="parametername">obj</span></td>
      <td><p>Object in the data model from which to get formatting information</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.string">string</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="FarPoint.Web.Spread.GeneralCellType.Format.html#FarPoint_Web_Spread_GeneralCellType_Format_System_Object_">GeneralCellType.Format(object)</a></div>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="FarPoint.Web.Spread.Renderer.IFormatter.Format.html#FarPoint_Web_Spread_Renderer_IFormatter_Format_System_Object_">IFormatter.Format(object)</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.argumentexception">ArgumentException</a></td>
      <td><p>Value cannot be converted to a DateTime object.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Web_Spread_DateTimeCellType_Format_" data-uid="FarPoint.Web.Spread.DateTimeCellType.Format*"></a>
<h4 id="FarPoint_Web_Spread_DateTimeCellType_Format_System_Object_System_String_System_IFormatProvider_" data-uid="FarPoint.Web.Spread.DateTimeCellType.Format(System.Object,System.String,System.IFormatProvider)">Format(object, string, IFormatProvider)</h4>
<div class="markdown level1 summary"><p>When deriving a cell type based on this type, override this<br>
to change what gets passed back and formatted as a string
into the cell on the sheet from the object in the data model.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public override string Format(object obj, string FormatString, IFormatProvider provider)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overrides Function Format(obj As Object, FormatString As String, provider As IFormatProvider) As String</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.object">object</a></td>
      <td><span class="parametername">obj</span></td>
      <td><p>Object in the data model from which to get formatting information</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">FormatString</span></td>
      <td><p>Format string built by the parser</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iformatprovider">IFormatProvider</a></td>
      <td><span class="parametername">provider</span></td>
      <td><p>IFormatProvider built by parser</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.string">string</a></td>
      <td><p>String representation</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">GeneralCellType.Format(object, string, IFormatProvider)</a></div>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="FarPoint.Web.Spread.Renderer.IEnhancedFormatter.Format.html#FarPoint_Web_Spread_Renderer_IEnhancedFormatter_Format_System_Object_System_String_System_IFormatProvider_">IEnhancedFormatter.Format(object, string, IFormatProvider)</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.argumentexception">ArgumentException</a></td>
      <td><p>Value cannot be converted to a DateTime object.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
