I try to get the date I received it in a epoch format and print it on a table.
If I put it directly
(Date(Math.round(new Date().getTime(vencimiento[i])/1000.0))).toLocaleString('en-US')
I get the correct date back, but if I try to save it and print it the date is totally different
var fechaVencimiento = new Date(Math.round(new Date().getTime(vencimiento[i])/1000.0)); console.log(fechaVencimiento);