0

i run a query which is giving me following results

enter image description here

but when i am trying to console it using JavaScript this is giving me one minus date from the results.

[
  RowDataPacket { total: 0, log_date: 2020-12-04T18:30:00.000Z },
  RowDataPacket { total: 0, log_date: 2020-12-07T18:30:00.000Z },
  RowDataPacket { total: 0, log_date: 2020-12-11T18:30:00.000Z }
]

why this is happening. both mysql and console output are on local.

Gaurav Singla
  • 51
  • 1
  • 7

1 Answers1

0

here is might be an explanation: What does this format means T00:00:00.000Z?.

in your case, you may try:

var d = new Date('2020-12-04T18:30:00.000Z');
console.log(d.getDay()); // Day is 5.
John Azar
  • 40
  • 1
  • 5