The code snippet use the DateTime class to calculate the start and end timestamps for the previous quarter. The calculations take into account the current month and adjust it to correctly identify the previous quarter. The time is explicitly set to midnight (00:00:00.000000) for the start timestamp and the end of the day (23:59:59.999999) for the end timestamp.
Source code viewer
// First day of previous quarter. ->modify('00:00:00.000000') ->getTimestamp(); // Llast day of previous quarter. ->modify('23:59:59.999999') ->getTimestamp();Programming Language: PHP