note 10045 added to date

From: Date: Sat, 09 Dec 2000 20:13:44 +0000
Subject: note 10045 added to date
Groups: php.notes 
Request: Send a blank email to php-notes+get-8551@lists.php.net to get a copy of this message
Estimated time: Month and days (as perhaps you already know) start from 1. Therefor if you estimate time using date() function you must deduct (-1) from it to make it accurate. i.e: echo "<P>Still ".(date("n", $time)-1)." month and ".(date("j", $time)-1)." days to wait for $something"; will give you "0 month and 20 days" if it's december 11-th and you need to know when new yearcomes. Maxim Maletsky http://www.php.net/manual/function.date.php

« previous php.notes (#8551) next »