note 15926 modified in ref.datetime by jimw

From: Date: Tue, 09 Oct 2001 19:46:59 +0000
Subject: note 15926 modified in ref.datetime by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-18727@lists.php.net to get a copy of this message
Simple way to calculate the days until something (looks like one of the entries above suggest multiplying instead of dividing!). This'll return a nice number formatted to two (2) decimal places. $today = time(); $daysuntil = ((($timestamp - $today) / 60) / 60) / 24; $daysuntil = number_format($daysuntil,2); --was-- Simple way to calculate the days until something (looks like one of the entries above suggest multiplying instead of dividing!). This'll return a nice number formatted to two (2) decimal places. $today = $strtotime("now"); $daysuntil = ((($timestamp - $today) / 60) / 60) / 24; $daysuntil = number_format($daysuntil,2); http://www.php.net/manual/en/ref.datetime.php

« previous php.notes (#18727) next »