Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
node-postgres current_date me da ayer como fecha actual

Estoy usando la página de la biblioteca pg para imprimir la fecha actual, sin embargo, da la fecha de ayer con la hora establecida en 21:00:00.000Z .

 const { Client } = require('pg') const client = new Client(); (async function fn() { await client.connect(); const res = await client.query("SELECT current_date"); const rows = res.rows; /** @type { Date } */ const dt = rows[0]['current_date']; console.log(dt); // 2022-06-04T21:00:00.000Z await client.end(); })();

Cuando emito el comando desde psql, obtengo la fecha actual correcta ("2022-06-05").

 SELECT current_date;

Mi zona horaria es UTC+03, así que supongo que tiene que ver con el motivo por el que obtengo este tipo de fecha, pero más allá de eso, no lo sé.

Amablemente ayude a explicar.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!