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

180
Views
Convert timestamp from API to date app script

Running in App script, google sheet. I get timestamp from API and return this result:

[[1.6370611672429312E18], [1.63706107263277082E18], [1.63706100204943616E18], [1.63706094340754534E18], [1.63706078474499994E18], [1.63706064715950106E18], [1.63706061367677235E18], [1.63706061367677082E18], [1.63706061367676902E18], [1.63706061367676749E18], [1.63706061367676595E18], [1.63706061367676442E18]], 

Now I want to convert this timestamp to date to be like that: 10/28/2021 10:30

I try this code: var convertDate = Utilities.formatDate(timestamp, "GMT", "MM-dd-yyyy HH:mm:ss"); but not working any suggestoin

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

0

Assuming those timestamps are in nanoseconds, create a Date by dividing the timestamp value by a million.

const timestamps = [[1.6370611672429312E18], [1.63706107263277082E18]];
for (let i = 0; i < timestamps.length; i++) {
  const timestamp = new Date(timestamps[i][0] / 1000000);
  const convertDate = Utilities.formatDate(timestamp, "GMT", "MM-dd-yyyy HH:mm:ss");
}
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!