DEV Community

Discussion on: JavaScript Dates in SQL

Collapse
 
induratized profile image
Abhinav Sharma

I guess Benjamin gave his Zone example with ISO.
You can use

${d.getDate()}-${d.getMonth()+1}-${d.getFullYear()} d.toTimeString().split(' ')[0]

, where d = new Date() , to get the local result.