|
|
<?
require_once( "Calc.php" );
$diff = Date_Calc::dateDiff( 1, 1, 2000, 1, 1, 2008 );
print $diff;
print "<hr>";
$dt = new Date_Calc();
$diff = $dt->dateDiff( 1, 1, 2000, 1, 1, 2008 );
print $diff;
?>
| |
|
|
|
|
if (!defined('DATE_CALC_FORMAT')) {
/**
* The default value for each method's $format parameter
*
* The default is '%Y%m%d'. To override this default, define
* this constant before including Calc.php.
*
* @since Constant available since Release 1.4.4
*/
define('DATE_CALC_FORMAT', '%Y%m%d');
}
| |
|
|
* %a abbreviated weekday name (Sun, Mon, Tue)
* %A full weekday name (Sunday, Monday, Tuesday)
* %b abbreviated month name (Jan, Feb, Mar)
* %B full month name (January, February, March)
* %d day of month (range 00 to 31)
* %e day of month, single digit (range 0 to 31)
* %E number of days since unspecified epoch (integer)
* (%E is useful for passing a date in a URL as
* an integer value. Then simply use
* daysToDate() to convert back to a date.)
* %j day of year (range 001 to 366)
* %m month as decimal number (range 1 to 12)
* %n newline character (\n)
* %t tab character (\t)
* %w weekday as decimal (0 = Sunday)
* %U week number of current year, first sunday as first week
* %y year as decimal (range 00 to 99)
* %Y year as decimal including century (range 0000 to 9999)
* %% literal '%'
| |
|
|
|