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

348
Views
Passing my payload through JSON.parse alters my date object values to not line up

Prior to using JSON.parse(), my payload contents are as follows:

let payload = {
     "name":"bob",
     "timeDetails":
        [
            {
                "windowName":"Window A",
                "windowTimes":
                    {
                        "startDate":"2021-11-20T20:39:46.785Z",
                        "endDate":"2021-11-20T20:39:54.786Z"
                    }
            }
        ]
    }

So paying particular attention to my dates, when I then proceed to issue the following on the above payload, i.e.:

let job = JSON.parse(payload);
console.log(job);

I am now getting the following startDate and endDate returned which is not the same as my original payload dates, i.e. from my console log:

startDate: Sun Nov 21 2021 16:00:00 GMT+1100 (Australian Eastern Daylight Time) {}
endDate: Sun Nov 21 2021 23:00:00 GMT+1100 (Australian Eastern Daylight Time) {}

I am not so much concerned about the time portion but I would've thought I would've seen the dates as: Sat Nov 20 2021 for both startDate/endDate?

Can someone help with what I am missing as need to ensure that dates are like for like.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Taking date string as UTC Time zone ("2021-11-20T20:39:46.785Z", UTC format). It adds 11 (GMT+1100 (Australian Eastern Daylight Time) hours to UTC time, so adding 11 hours to Nov 20 gets Nov 21 as a result If you want to get the Exact UTC zone we have to convert it to UTC format

about 4 years ago · Juan Pablo Isaza Report
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!