I have a column type date
and I try to insert a date but it throws me the following error:
Invalid parameter value: 7 ERROR: the time zone «gmt-0400» is not recognized (SQL: insert into "lots" ("number", "id_products", "date", "id_turns", "updated_at", "created_at") values (700011, 4, Tue Mar 07 2017 00:00:00 GMT-0400 (Western Standard Time, South America), 11, 2017-03-07 18:37:48, 2017-03-07 18: 37:48) returning "id")
The problem is the use of time, how can I delete it in javascript.
I have a string
with the following format: dd/mm/año
an ex of this is: 07/03/2017
I pass it to a date with new Date()
and I am left as follows: Tue Mar 07 2017 00:00:00 GMT-0400 (Hora estándar oeste, Sudamérica)
The code is the sig:
var fechaInput = $('#crear_fecha').val();
var fecha = new Date(fecha);
NOTE: I do not know which is better to solve, javascript or modify the column of the DB.