I am currently facing an issue with a Google Form connected to a Google Spreadsheet. The date format in the spreadsheet appears as follows when a response is received:
20/02/2023 18:58:59
I am seeking guidance on how to convert this date format using Typescript.
During the website development process, I was able to temporarily solve it by performing the following steps:
datestr = '20/02/2023 18:58:59'
datestr = Date(datestr)
d = new Date(datestr)
However, I encountered numerous errors during production build. One of them being that the Date(d)
function cannot be called because Date()
does not accept arguments. Additionally, using new Date(datestr)
directly simply returns Invalid date
.
Could someone provide suggestions on how to address this issue? It would be ideal to utilize built-in types to avoid manual date manipulation.