]> source.dussan.org Git - nextcloud-server.git/commitdiff
add dateOnly option to formatDate
authorRobin Appelman <icewind1991@gmail.com>
Thu, 2 Jun 2011 00:28:43 +0000 (02:28 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Thu, 2 Jun 2011 00:29:16 +0000 (02:29 +0200)
lib/base.php

index 4bc96ad88f67f358b40eb1beace9408a3a8f73df..a2401ecde2e0dab0e32773677b1f357d4c13bf82 100644 (file)
@@ -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);
         }