Scheduled Report won't send correct dates:

smartcookie
Tera Contributor

Trying to get a report that collects the records from the previous month and sends to people across multiple timezones, But it keeps using the month prior to the one I am supposed to collect

 

    var gd_end = new GlideDateTime();

    gd_end.setDayOfMonthUTC(1);
   
    gd_end.addDays(-1);
    var gd_beginning = new GlideDateTime();

    gd_beginning.setDayOfMonthUTC(1);
    gd_beginning.addDays(-1);
    gd_beginning.setDayOfMonthUTC(1);
    var gf_beginning = gd_beginning.getDate().getByFormat('MMMM dd');
    var gf_month = gd_beginning.getDate().getByFormat('MMMM');
    var gf_end = gd_end.getDate().getByFormat('MMMM dd, YYYY');
 
The report should be running at 1 AM UTC so what is going on here?
0 REPLIES 0