Bugs item #1248111, was opened at 2005-07-30 20:34
Message generated for change (Comment added) made by iridium
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377952&aid=1248111&group_id=23245
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Output
Group: None
>Status: Closed
Priority: 5
Submitted By: Juan Cabanela (jcabanela)
Assigned to: Nobody/Anonymous (nobody)
Summary: Error in print_pretty_time($time)
Initial Comment:
Your are "round"ing the number of hours instead of using "floor" such
that a 97 minute difference between the present and the time
reported is listed as "2 hours 37 minutes" by print_pretty_time().
Change the first four lines of this function from:
function print_pretty_time($time) {
$minutes_old = round((time() - $time)/60);
if ($minutes_old > 60) {
$hours = round((time() - $time)/3600);
$minutes = $minutes_old % 60;
and instead use:
function print_pretty_time($time) {
$minutes_old = round((time() - $time)/60);
if ($minutes_old > 60) {
$hours = floor((time() - $time)/3600); //CHANGE MADE HERE
$minutes = $minutes_old % 60;
That makes this routine report the correct time since the weather
data was gathered.
----------------------------------------------------------------------
>Comment By: Max Hammond (iridium)
Date: 2006-03-09 17:46
Message:
Logged In: YES
user_id=81516
Well spotted. Fixed locally, I'll commit to CVS once I've
cleared all the stuff I haven't touched since last year :-)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377952&aid=1248111&group_id=23245
|