You are here

protected function StatsPro::get_first_month_of_quarter_from_reference in Statistics Pro 6.2

Same name and namespace in other branches
  1. 6 statspro.inc \statspro::get_first_month_of_quarter_from_reference()

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

Parameters

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

Return value

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

2 calls to StatsPro::get_first_month_of_quarter_from_reference()
StatsPro::get_first_day_of_quarter_from_reference in ./statspro.inc
Returns a YYYY-MM-DD date representation of the first day of same the quarter as the reference day.
StatsPro::get_last_day_of_quarter_from_reference in ./statspro.inc
Returns a YYYY-MM-DD date representation of the last day of same the quarter as the reference day.

File

./statspro.inc, line 392
statspro class for Statistics Pro module.

Class

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

Code

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