title: ant design - datepicker with time saves with 00:00:00 as time?
body: <p>So im using antd for my design in frontend with React. I want to store an object with datetime in database. I see that antd's Datepicker is capable of that but it always stores in my database with 00:00:00 as time. Date, month year are ok.</p>
  <p>I tried to use <code>moment().format('YYYY-MM-DD HH:mm:ss')</code> and save it like that in the database but i get error <code>Uncaught TypeError: date.clone is not a function</code></p>
  <p>This is my datepicker. The issue raises when i try to use my setPickedFrom function from useState. Why is this a problem?</p>
  <pre><code>&lt;DatePicker
                  allowClear={false}
                  placeholder=&quot;Rent from: &quot;
                  // format=&quot;YYYY-MM-DD HH:mm:ss&quot;
                  disabledDate={disabledDate}
                  onChange={(e) =&gt; onDateClear(e, &quot;from&quot;)}
                  onOk={(date) =&gt;
                    setPickedFrom(
                      moment(date).format(&quot;YYYY-MM-DD HH:mm:ss&quot;),
                      &quot;to&quot;
                    )
                  }
                  value={pickedFrom ? pickedFrom : null}
                  showTime
                  className=&quot;date-picker2&quot;
                /&gt;
  
  </code></pre>
  <p>Saving the dates function (Create Rent)</p>
  <pre><code>  const createRent = () =&gt; {
      axios
        .post(&quot;http://localhost:5000/rents/createRent&quot;, {
          date_from: pickedFrom,
          date_to: pickedUntil,
          userId: user.id,
          itemId: currentItem.id,
        })
        .then(() =&gt; {
          showNotification(&quot;Item rented&quot;);
          setCurrentItem({});
          setDifference(null);
          setIsModalVisible(false);
          setPickedFrom(null);
          setPickedUntil(null);
        })
        .catch((e) =&gt; {
          showNotification(e.response.data.message, &quot;error&quot;);
        });
    };
  </code></pre>
  <p>I just need to find a way to save date and time in my database in the following format (YYYY-MM-DD HH:mm:ss) because this is the accepted format for my database.</p>