Last Updated: February 25, 2016
·
692
· wensonsmith

Convert Timestamp to Quarter

/**
 * Convert  Timestamp to Quarter
 * @returns String 2013Q3
 */
function quarter($timestamp) {
   return date("Y\Q",$timestamp).ceil(date('n', $timestamp)/3);
}