new Date('2020-02-21' + 'T00:00'); // or new Date('2020-02-21T00:00'); //or const dateFromDateInput = '2020-02-21'; const dateFromTimeInput = '05:00'; cosnt baseDate = (new Date(`${dateFromDateInput}T${dateFromTimeInput}`)); //then, now you can use date-fns getUnixTime to turn it into timestamp //turn timestamp into human readable date with fromUnixTime
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter