- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 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;
}
Ну... индусы старались ....