I am saving the date to SQL database from nodejs. While saving the date to SQL I am getting error " parameter.value.getTime ".
While passing a date in this format while passing it to SQL.
2018-06-27T18:30:00.000Z
In early records in the database, DateTime format is this one.
2018-05-25 14:39:19.433
How can I solve this error? I already used moment js to use another format for saving the date but it is not working.
You should not try to change the format of your String, but convert it into JavaScript Date instead:
var yourDate = new Date(yourString);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With