From a3bc6979a99444f29da1aa7973338e3dcd72d309 Mon Sep 17 00:00:00 2001 From: Benaka Moorthi Date: Fri, 9 Aug 2013 19:25:50 -0400 Subject: Refs #3089, add initial visitor profile popup that uses dynamic data from Live plugin API. No client-side behavior yet & placeholder images still present. --- core/Date.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/Date.php') 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; + } } -- cgit v1.2.3