Code Duplication    Length = 6-6 lines in 2 locations

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

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

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

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