title: How to input DateTime Now in ASP.NET MVC from the hidden form input to database MySQL?
body: <p>I want to input datetime now to record add item time. I currently use an input form with a hidden type to insert datetime into the database table column but it fails. How do I input datetime now in realtime with the format yyyy-mm-dd hh: mm: ss time format 24 hours into the database?, for example 2019-10-23 16:30:49. I am using ASP.NET MVC with MySql Database. Thank You</p>
  
  <pre><code>&lt;form class="form-horizontal" method="post" action="CreateItem"&gt;
      &lt;input type="text" class="form-control" name="NameItem"&gt;
      &lt;input type="hidden" class="form-control" name="AddTime" value="DateTimeNow"&gt;
  &lt;/form&gt;
  </code></pre>