diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-08-10 03:25:50 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-08-10 03:25:50 +0400 |
commit | a3bc6979a99444f29da1aa7973338e3dcd72d309 (patch) | |
tree | 2ac49526db2e40a9a3dfedd0b95cb68b07062265 /core/Date.php | |
parent | cfb17ed2795101ea90d71d124d91b0cbad09858c (diff) |
Refs #3089, add initial visitor profile popup that uses dynamic data from Live plugin API. No client-side behavior yet & placeholder images still present.
Diffstat (limited to 'core/Date.php')
-rw-r--r-- | core/Date.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Date.php b/core/Date.php index 3fb96665e0..22580bd492 100644 --- a/core/Date.php +++ b/core/Date.php @@ -19,6 +19,8 @@ use Exception; */ class Date { + const NUM_SECONDS_IN_DAY = 86400; + /** * The stored timestamp is always UTC based. * The returned timestamp via getTimestamp() will have the conversion applied @@ -641,4 +643,15 @@ class Date { return $this->addPeriod(-$n, $period); } + + /** + * Returns the number of days represented by a number of seconds. + * + * @param int $secs + * @return float + */ + public static function secondsToDays($secs) + { + return $secs / self::NUM_SECONDS_IN_DAY; + } } |