• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

12
Views
how to get past days from current time

I get Current date and time by this code:

`var formattedDate = Utilities.formatDate(new Date(), "GMT", "yyyy-MM-dd'T'HH:mm:ss'Z'");
 Logger.log(formattedDate)`

I want to get date in last 8 days or any last date example this code give me 2021-09-18T22:17:00Z I want result like that 2021-09-10T22:17:00Z . first date -8 days

I'm using Google App Script

29 days ago ·

Juan Pablo Isaza

1 answers
Answer question

0

let d = new Date();
d.setDate(d.getDate()-8);
console.log(d);

29 days ago · Juan Pablo Isaza Report
Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.