note 67265 modified in function.gregoriantojd by danbrown

From: Date: Sun, 20 Jul 2008 01:58:57 +0000
Subject: note 67265 modified in function.gregoriantojd by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141930@lists.php.net to get a copy of this message
<?php /* * ComputeDateDifference(...) * Description: * Calculates the difference between two dates. * * Parameter: * $m0, $d0, $y0 => 1. Moth/Day/Year * $m1, $d1, $y1 => 2. Moth/Day/Year * * Return: * Difference between given dates in days. * * Autor: * 06.06.2006 - Christian Meyer <ryker@ridgex.net> */ function ComputeDateDifference($m0,$d0,$y0,$m1,$d1,$y1) { $x0 = gregoriantojd($m0,$d0,$y0); $x1 = gregoriantojd($m1,$d1,$y1); $diff = $x1 - $x0; if ($diff < 0) $diff *= -1; // abs return $diff; } ?> --was-- /* * ComputeDateDifference(...) * Description: * Calculates the difference between two dates. * * Parameter: * $m0, $d0, $y0 => 1. Moth/Day/Year * $m1, $d1, $y1 => 2. Moth/Day/Year * * Return: * Difference between given dates in days. * * Autor: * 06.06.2006 - Christian Meyer <ryker@ridgex.net> */ function ComputeDateDifference($m0,$d0,$y0,$m1,$d1,$y1) { $x0 = gregoriantojd($m0,$d0,$y0); $x1 = gregoriantojd($m1,$d1,$y1); $diff = $x1 - $x0; if ($diff < 0) $diff *= -1; // abs return $diff; } http://php.net/manual/en/function.gregoriantojd.php

« previous php.notes (#141930) next »