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

129
Views
get last week start date from current date time in servicenow

As per my requirement if I pass the date-time then, How I can find which date is present on last week?

E.g.

var date1 = new GlideDateTime('2021-10-06 09:00:24');
var date2 = new GlideDateTime('2021-10-12 09:00:37');

Output:-

date 1 is present on last week.
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could use this function comparing the numbers of the weeks :

function isLastWeek(gdt){
    return gdt.getWeekOfYearLocalTime() === new GlideDateTime().addWeeksLocalTime(-1).getWeekOfYearLocalTime();
}
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!