Skip to content

Instantly share code, notes, and snippets.

@steveirl
steveirl / list_quarters.php
Last active December 21, 2021 20:09
Get a list of (date) quarters between two given dates. Return array of objects with information about each quarter
<?php
// get month name from number
function month_name($month_number){
return date('F', mktime(0, 0, 0, $month_number, 10));
}
// get get last date of given month (of year)
function month_end_date($year, $month_number){