Code Duplication    Length = 6-6 lines in 2 locations

main/inc/lib/attendance.lib.php 1 location

@@ 1770-1775 (lines=6) @@
1767
		$values = api_get_utc_datetime($timestamp);
1768
		$values = str_replace(array(':','-',' '), '/', $values);
1769
		list($y, $m, $d, $h, $n, $s) = split('/',$values);
1770
		if($m+$num>12) {
1771
			$y += floor($num/12);
1772
			$m += $num%12;
1773
		} else {
1774
			$m += $num;
1775
		}
1776
		//date_default_timezone_set('UTC');
1777
		// return mktime($h, $n, $s, $m, $d, $y);
1778
		$result = api_strtotime($y.'-'.$m.'-'.$d.' '.$h.':'.$n.':'.$s, 'UTC');

main/inc/lib/agenda.lib.php 1 location

@@ 2421-2426 (lines=6) @@
2418
    function addMonth($timestamp, $num = 1)
2419
    {
2420
        list($y, $m, $d, $h, $n, $s) = split('/', date('Y/m/d/h/i/s', $timestamp));
2421
        if ($m + $num > 12) {
2422
            $y += floor($num / 12);
2423
            $m += $num % 12;
2424
        } else {
2425
            $m += $num;
2426
        }
2427
        return mktime($h, $n, $s, $m, $d, $y);
2428
    }
2429