src/Webiny/AnalyticsDb/DateHelper.php
public static function rangeLastMonth()
    {
        $lastMonth = date('m') - 1;
        if ($lastMonth <= 0) {
            $lastMonth = 12;
        }
        $lastMonth = date('Y') . '-' . $lastMonth . '-01';

        return [self::toTs($lastMonth), self::toTs($lastMonth) + (86400 * (date('t', strtotime($lastMonth))-1))];
    }
public static function rangeLastMonth()
    {
        $lastMonth = date('m') - 1;
        if ($lastMonth <= 0) {
            $lastMonth = 12;
        }
        $lastMonth = date('Y') . '-' . $lastMonth . '-01';

        return [self::toTs($lastMonth), self::toTs($lastMonth) + (86400 * (date('t', strtotime($lastMonth))-1))];
    }
public static function rangeLastMonth ( ) { $ lastMonth = date ( 'm' ) - 1 ; if ( $ lastMonth <= 0 ) { $ lastMonth = 12 ; } $ lastMonth = date ( 'Y' ) . '-' . $ lastMonth . '-01' ; return [ self :: toTs ( $ lastMonth ) , self :: toTs ( $ lastMonth ) + ( 86400 * ( date ( 't' , strtotime ( $ lastMonth ) ) - 1 ) ) ] ; }
Returns a date range for the previous month.

@return array
Returns a date range for the previous month .