1. PHP / Говнокод #21434

    −20

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    function __timediff($d1, $d2) 
    {
    		list($t1_1, $t1_2) = explode(' ', $d1);
    		list($t1_y, $t1_m, $t1_d) = explode('-', $t1_1);
    		list($t1_h, $t1_i, $t1_s) = explode(':', $t1_2);
    
    		$t1 = mktime($t1_h, $t1_i, $t1_s, $t1_m, $t1_d, $t1_y);
    
    		list($t2_1, $t2_2) = explode(' ', $d2);
    		list($t2_y, $t2_m, $t2_d) = explode('-', $t2_1);
    		list($t2_h, $t2_i, $t2_s) = explode(':', $t2_2);
    
    		$t2 = mktime($t2_h, $t2_i, $t2_s, $t2_m, $t2_d, $t2_y);
    
    		if ($t1 == $t2)
    			return 0;
    		return $t2 - $t1;
    }

    Ну... индусы старались ....

    Запостил: Tsukasa-mixer, 13 Октября 2016

    Комментарии (3) RSS

    Добавить комментарий