note 54458 deleted from function.time by aidan
| From: | aidan@php.net | Date: | Sat, 08 Oct 2005 01:02:14 +0000 |
| Subject: | note 54458 deleted from function.time by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96598@lists.php.net to get a copy of this message | ||
Note Submitter: davenewt
----
Re the note from 'shazow'... I tried using the given function, passing it an SQL timestamp
(in the form YYYY-MM-DD hh:mm:ss) but the number of months it was returning seemed way off...
thought I should post back in case anyone else was scratching their head over it...
Noticed the following code:
<?php
// Months
$elapsedString = round($elapsedTime/60/60/24/12, $roundTo) . " months";
?>
...which is assuming 12 days in a month? I changed this to:
<?php
// Months
$elapsedString = round($elapsedTime/60/60/24/30, $roundTo) . " months";
?>
(I'm assuming 30 days per month as in my application I don't need to be exact... not sure
how you could be?)
Hope this is an acceptable 'hack'. I'm no professional!
Cheers,
Dave.