0
votes

I am trying to save a TimePicker time ('HH:mm') innto the database with the right format. So far I managed to get the right timezone but I can't find the way of including .format('HH:mm') in momnet with out my app crashing.

           <TimePicker
            defaultValue={moment()}
            format={'HH:mm'}
            hourStep={1}
            minuteStep={15}
            value={moment.utc(supplier.orderCutOffTime)}
            onChange={value => {
              setEditingSupplier({
                ...supplier,
                orderCutOffTime: value,
              })
            }}
          />

So far I get this in the BD:

    "orderCutOffTime" : "2022-07-27T03:45:56.959Z",

I have really tried to include it everywhere. Any help would be much appreciated!

Cheers!