From: Robin Appelman Date: Thu, 2 Jun 2011 00:28:43 +0000 (+0200) Subject: add dateOnly option to formatDate X-Git-Tag: v3.0~267^2~558^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=09458aa639791703aca00d5bf062fb6505ba4126;p=nextcloud-server.git add dateOnly option to formatDate --- diff --git a/lib/base.php b/lib/base.php index 4bc96ad88f6..a2401ecde2e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -232,10 +232,11 @@ class OC_UTIL { /** * formats a timestamp in the "right" way * - * @param timestamp $timestamp + * @param int timestamp $timestamp + * @param bool dateOnly option to ommit time from the result */ - public static function formatDate( $timestamp ){ - $timeformat='F j, Y, H:i'; + public static function formatDate( $timestamp,$dateOnly=false){ + $timeformat=$dateOnly?'F j, Y':'F j, Y, H:i'; return date($timeformat,$timestamp); }