title: Is possible to change the format of a datetime-local input
body: <blockquote>
    <p>NOTE: This question is not a <strong>duplicate</strong>, the reason is that I don't use only PHP, It's true that my pages are elaborated in PHP but with code of HTML. </p>
  </blockquote>
  
  <p>I will repeat it once again, certainly I use php, but I use HTML in my PHP archives;  I'm working using <strong>laravel framework</strong> and also I use blade, I put the link from the page that was mentioned.</p>
  
  <p><a href="https://stackoverflow.com/questions/18206530/changing-the-datetime-format-in-php">Changing the datetime format in php</a></p>
  
  <p><strong>Now, I continue with explaining my problem.</strong></p>
  
  <p>I have an input into a form and his type is datetime-local, the input show me the date in this format: </p>
  
  <p><em>dd-mm-yyyy 00:00</em></p>
  
  <p>But in my database the format of datetime is:</p>
  
  <p><em>yyyy-mm-dd 00:00:00</em></p>
  
  <p>I already know that this datetime format is about my time zone configuration but If it's possible I would like to change the format, <strong>visually and save as that format, just like in my database</strong>. I'm talking only about the date, not the time. </p>
  
  <p>I think that if is possible I will not have problems with my database. </p>
  
  <p>If it possible, I would like to change the format using, javascript or in my function <code>save()</code> of my controller, create a way to change the format. My database is in mysql, I work in phpmyadmin.</p>
  
  <p>Also I put my function <code>store()</code> of my Controller.</p>
  
  <pre><code>public function store(Request $request){
  
  
      $hours = new HoursNew();
  
      try {
      /*THE NAME FROM THE INPUTS IN MY FORM, 
      ALSO THE NAMES OF THE FIELDS OF MY TABLE OF MY DATABASE*/ 
  
          $hours-&gt;id = $request-&gt;id;
          $hours-&gt;time_start = $request-&gt;time_start;
          $hours-&gt;time_end = $request-&gt;time_end;
          $hours-&gt;estate_time_id = $request-&gt;estate_time_id;
          $hours-&gt;court_id = $request-&gt;court_id;
          $hours-&gt;save();
  
  
      } catch (\Illuminate\Database\QueryException $e) {
  
           Session::flash('error', 'Ups! We have some problems to process your operation');
  
          return redirect()-&gt;route('ListHours.store');
  
      }
  
          Session::flash('message', "It's OK");
          return redirect()-&gt;route('ListHours.store');
  
  }
  </code></pre>
  
  <p>NOTE: <em>Is not very important to my database but is important to know it</em>: </p>
  
  <p>The seconds is not very important to save into my database.</p>