You are here

protected function statspro::get_last_month_of_quarter_from_reference in Statistics Pro 6

Same name and namespace in other branches
  1. 6.2 statspro.inc \StatsPro::get_last_month_of_quarter_from_reference()

Returns the last month of same the quarter as the reference day.

Parameters

<int> $reference A timestamp representaing the reference day.:

Return value

<int> Last month of the same quarter of the reference day.

File

./statspro.inc, line 321
statspro class for statistics pro module.

Class

statspro
Manages the data saving and retrieval according to the user defined parameters.

Code

protected function get_last_month_of_quarter_from_reference($reference) {
  $month = date('m', $reference);
  $last_month = floor(($month - 1) / 3);
  $last_month = (int) (($last_month + 1) * 3);
  return sprintf('%02u', $last_month);
}