diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-06-02 02:28:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-06-02 02:29:16 +0200 |
commit | 09458aa639791703aca00d5bf062fb6505ba4126 (patch) | |
tree | 88a9580887f52574c5491c6fe15448ed70f1e1bc | |
parent | c1d02fd1664ef0450779bcb03e849aea74bbf28d (diff) | |
download | nextcloud-server-09458aa639791703aca00d5bf062fb6505ba4126.tar.gz nextcloud-server-09458aa639791703aca00d5bf062fb6505ba4126.zip |
add dateOnly option to formatDate
-rw-r--r-- | lib/base.php | 7 |
1 files changed, 4 insertions, 3 deletions
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); } |