title: Submitted datetime is converted to "0001-01-01T00:00:00"
body: <p>In my Razor Pages .NET Core 3.1 application I have the following simple form</p>
  <pre><code>&lt;form method=&quot;post&quot; id=&quot;formReport&quot;&gt;
    &lt;div class=&quot;form-group&quot;&gt;
      &lt;label asp-for=&quot;Parameters.From&quot; class=&quot;control-label&quot;&gt;&lt;/label&gt;
      &lt;input id=&quot;txtFrom&quot; asp-for=&quot;Parameters.From&quot; type=&quot;text&quot; class=&quot;form-control&quot; style=&quot;width:90%;&quot; /&gt;
    &lt;/div&gt;
    &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary btn-sm&quot; title=&quot;Show report&quot;&gt;
      &lt;i class=&quot;far fa-eye&quot;&gt;&lt;/i&gt; Show Report
    &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  <p><code>txtForm</code> is a date input field implemented using DateTimePicker jQuery plugin (<a href="https://xdsoft.net/jqplugins/datetimepicker/" rel="nofollow noreferrer">https://xdsoft.net/jqplugins/datetimepicker/</a>).</p>
  <pre><code>var from = $('#txtFrom').datetimepicker({
              format: 'd/m/Y H:i',
              formatDate: 'Y/m/d',
              formatTime: 'H:i',
              defaultTime: '06:00',
              mask: '39/19/9999 29:59',
              monthChangeSpinner: true,
              onChangeDateTime: function (dp, $input) {
                  console.log($input.val());
              }
         });
  </code></pre>
  <p>The output from <code>console.log</code> above when I enter as date <code>13/02/2022 06:00</code> is the same: <code>13/02/2022 06:00</code>. So, I guess, this is the value submitted via POST. But on server-side I get <code>&quot;0001-01-01T00:00:00&quot;</code>.</p>
  <p>The code works fine when run in Debug mode from Visual Studio, or when I deploy it to a local web server. But when the app is deployed to production site using Docker the form submission doesn't work. Submitted value is converted to <code>&quot;0001-01-01T00:00:00&quot;</code>.</p>
  <p>This is the <code>Dockerfile</code> I am using:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/aspnet:3.1-bionic-arm64v8 AS base
  WORKDIR /app
  EXPOSE 80
  
  FROM mcr.microsoft.com/dotnet/sdk:3.1-bionic-arm64v8 AS build
  WORKDIR /src
  COPY [&quot;myApp.Web/myApp.Web.csproj&quot;, &quot;myApp.Web/&quot;]
  RUN dotnet restore &quot;myApp.Web/myApp.Web.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/myApp.Web&quot;
  RUN dotnet build &quot;myApp.Web.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;myApp.Web.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  
  # Create a folder for saving images; this folder exists in container filesystem
  # and has to be mounted to folder of the host filesystem inside docker-compose
  RUN mkdir -p /app/images
  
  ENTRYPOINT [&quot;dotnet&quot;, &quot;myApp.Web.dll&quot;]
  </code></pre>
  <p>For some reason when date is submitted it is not properly converted to a DateTime value by the model binder. Any ideas what I could do to solve the issue?</p>