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

188
Views
How to determine if it is currently Daylight savings time when local time is running on UTC in JavaScript using .isDST() or similar

My issue is- using Postman to parse a JSON API response, I am getting back date and time in UTC. This value could return two possible times; one when DST is active, and one when DST is not active. This is because the time is set in the DB as EST so the delta between UTC/EST/DST is either (-4) or (-5).

As an example, lets say the time in the database is set to 01:00:00 PM Eastern. During DST, this is 05:00:00 PM UTC, during EST this is 06:00:00 PM UTC.

The issue then is, the box we are running these tests on is set to UTC. So I cannot use the delta between "local time" and UTC using getTimezoneOffset to determine the if it is currently DST using the delta. isDST() always returns false for UTC.

I am basically looking to do simple logic to say

if(isDST = true){
   expect(time === 01:00:00);
}
else{
   expect(time === 02:00:00);
}

Any suggestions on how I may be able to determine if DST is currently in effect in this scenario?

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!