src/TimeLib.php
/**
     * Rounds a timestamp down to midnight on the first of the month it was 
     * taken
     * @param timestamp - the timestamp to round off.
     * @return roundedTimestamp - the rounded timestamp
     */
Rounds a timestamp down to midnight on the first of the month it was
taken
@param timestamp - the timestamp to round off.
@return roundedTimestamp - the rounded timestamp
Rounds a timestamp down to midnight on the first of the month it was taken @param timestamp - the timestamp to round off . @return roundedTimestamp - the rounded timestamp
public static function roundTimestampDownToMonth($timestamp)
    {
        $month = date('n', $timestamp);
        $year  = date('Y', $timestamp);
        $roundedTimestamp = mktime(0, 0, 0, $month, $day="01", $year);
        return $roundedTimestamp;
    }
public static function roundTimestampDownToMonth ( $ timestamp ) { $ month = date ( 'n' , $ timestamp ) ; $ year = date ( 'Y' , $ timestamp ) ; $ roundedTimestamp = mktime ( 0 , 0 , 0 , $ month , $ day = " 01 " , $ year ) ; return $ roundedTimestamp ; }
Rounds a timestamp down to midnight on the first of the month it was
 taken
 @param timestamp - the timestamp to round off.
Rounds a timestamp down to midnight on the first of the month it was taken @param timestamp - the timestamp to round off .