I need to get time in "00:00:00" type. I have field to do this, but if I get 00 in last place I have "02:02". I try to use time.lenght, and I want to add missing number, buti it is dosn't work...
<input id="preparation_time" defaultValue = "00:00:00" type="time" step="1" className={styles.input} onChange={e => this.order.preparation_time = e.target.value}/>
and I have in console when I click submit only "02:02: not "02:02:00:
async submit(){
this.setState({error : false});
this.setState({response : false});
console.log(this.order.preparation_time);
(..)
If I enter seconds, they are but if I enter zero, they disappear and I don't know how to add these zeros. I can't get the length.
Sory I wrote lenght, no length. But if whos want to know why is no second. Answer is below.


20:02? I don't see any "20:02"How I can get time in "00:00:00" format?<-- where, in console.log? in rendered? explaing better your question