Schedule job on 2nd sunday of a month
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 11:31 PM
Hi All,
I would like to run a schedule job on 2nd Sunday of a month.Can we directly get the week through any function?
Regards,
kirti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2015 12:44 AM
Well, then you can set the schedule of the scheduled Job to weekly to run every Tuesday. Then you check on the condition field and add something were it calculates the difference between the current data and gs.beginningOfThisMonth(). If it below seven, then you have not get yet to the second tuesday, if it's above 15, then you're ahead of the second tuesday.
I hope it helps!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2016 09:57 PM
Hi Kirti,
Did you get the solution for this? I have the same requirement where I need to schedule a job to run on 2nd Monday of every month.
Thanks,
Prajakta

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2016 10:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2016 10:09 PM
Hi kirti,
i have done with below script and it worked perfectly for me.
function checksecondsunday() {
var gdt = new GlideDateTime();
var day = gdt.getDayOfWeek();
var result = true;
if (day == 0 && (gdt.getDate() >7 && gdt.getDate()<=14)){
result = true;
}
return result;
}
checksecondsunday();