I am getting time input in the format of string. I need to convert it to datetime type in order to send it to the API. How can I convert a string to datetime?
<input
placeholder="enter time"
type="time"
onChange={(e) => setTime(e.target.value)}
/>
Need to convert Time to datetime datatype.