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

228
Views
Date in Google App Scrip (Make de calculation using 2 Date and return the numer of da days)

I just want to make a simple calculation using 2 Dates.

Ex: in the Sheet Cell A1 = 10/11/2021 and cell A2 = 12/11/2021

The function takes the date and calculation (10/11/2021 - 12/11/2021) and returns in Cell A3 the number 2.

This sounds very easy, but I can't do this probably because of the format of the Date that I can't change.

Please let me know the solution.

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

0

When you do calculation on the date objects, they would be converted into milliseconds, so the following would give you the difference in days:

  const diff = (d2 - d1) / 1000*60*60*24;
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!