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

292
Views
node-postgres current_date gives me yesterday as current date

I am using the npm library pg to print the current date, however it gives the date of yesterday with the time set to 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();
})();

When I issue the command from psql I get the correct current date ("2022-06-05").

SELECT current_date;

My timezone is UTC+03 so I am guessing it has to do with why I am getting this kind of date, but beyond that I dont know.

Kindly help explain.

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!