# C1.WPF.Schedule.DateTimeToStringConverter

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Schedule_DateTimeToStringConverter" data-uid="C1.WPF.Schedule.DateTimeToStringConverter" class="text-break">DateTimeToStringConverter Class
</h1>
  <div class="markdown level0 summary"><p>Represents a Binding converter that converts a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.datetime">DateTime</a>
to one of its string representations.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">DateTimeToStringConverter</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.data.ivalueconverter">IValueConverter</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Schedule.html">C1.WPF.Schedule</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Schedule.4.6.2.dll</h6>
  <h5 id="C1_WPF_Schedule_DateTimeToStringConverter_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[ValueConversion(typeof(DateTime), typeof(string))]
public class DateTimeToStringConverter : IValueConverter</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;ValueConversion(GetType(Date), GetType(String))&gt;
Public Class DateTimeToStringConverter
    Implements IValueConverter</code></pre>
  </div>
  <h5 id="C1_WPF_Schedule_DateTimeToStringConverter_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;xref href=&quot;C1.WPF.Schedule.DateTimeToStringConverter&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; is a two-way converter. The source value 
</code></pre>
<p>must be the DateTime, and a target value is a string that represents the DateTime
according to a format specifier defined in a converter parameter. The format
specifier definition rules are the same as used in the
System.DateTime.ToString(format) method. A back conversion is performed via
the DateTime.DateTime.TryParseExact method if converter parameter is specified;
otherwise, the DateTime.DateTime.TryParse method is used.</p>
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_DateTimeToStringConverter__ctor" data-uid="C1.WPF.Schedule.DateTimeToStringConverter.#ctor">
          <a class="xref" href="C1.WPF.Schedule.DateTimeToStringConverter.-ctor.html#C1_WPF_Schedule_DateTimeToStringConverter__ctor">DateTimeToStringConverter()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.WPF.Schedule.DateTimeToStringConverter.html">DateTimeToStringConverter</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_DateTimeToStringConverter_Default" data-uid="C1.WPF.Schedule.DateTimeToStringConverter.Default">
          <a class="xref" href="C1.WPF.Schedule.DateTimeToStringConverter.Default.html">Default</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an instance of <a class="xref" href="C1.WPF.Schedule.DateTimeToStringConverter.html">DateTimeToStringConverter</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_DateTimeToStringConverter_Convert_System_Object_System_Type_System_Object_System_Globalization_CultureInfo_" data-uid="C1.WPF.Schedule.DateTimeToStringConverter.Convert(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)">
          <a class="xref" href="C1.WPF.Schedule.DateTimeToStringConverter.Convert.html#C1_WPF_Schedule_DateTimeToStringConverter_Convert_System_Object_System_Type_System_Object_System_Globalization_CultureInfo_">Convert(object, Type, object, CultureInfo)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts a value. The data binding engine calls this method
when it propagates a value from the binding source to the binding target.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_DateTimeToStringConverter_ConvertBack_System_Object_System_Type_System_Object_System_Globalization_CultureInfo_" data-uid="C1.WPF.Schedule.DateTimeToStringConverter.ConvertBack(System.Object,System.Type,System.Object,System.Globalization.CultureInfo)">
          <a class="xref" href="C1.WPF.Schedule.DateTimeToStringConverter.ConvertBack.html#C1_WPF_Schedule_DateTimeToStringConverter_ConvertBack_System_Object_System_Type_System_Object_System_Globalization_CultureInfo_">ConvertBack(object, Type, object, CultureInfo)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts a value. The data binding engine calls this method when it propagates
a value from the binding target to the binding source.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
