public static str monthToDateRange(int relativeDays = 0) { utcdatetime currentDateTime; currentDateTime = DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(), DateTimeUtil::getUserPreferredTimeZone()); SysQueryRangeUtil::dateRange( dateStartMth(DateTimeUtil::date(currentDateTime)), DateTimeUtil::date(DateTimeUtil::addDays(currentDateTime, relativeDays))); }
The code must be added to the SysQueryRangeUtil class.
Use it like (monthToDate(n)) where n is the number of days from today. So month-to-date-yesterday would for example be (monthToDate(-1)).