Javascript date to sql date object

前端 未结 3 1671
面向向阳花
面向向阳花 2020-12-09 17:07

I\'m trying to write a query that takes a Javascript date object and then puts it in an object type that is recognized by both SQL Server and Oracle database types.

3条回答
  •  感动是毒
    2020-12-09 17:26

    May be I found a bit shorter approach - tested on MSSQL and Postgres

    const date = (new Date()).toLocaleString("en-US")
    

    Enjoy!

提交回复
热议问题