summaryrefslogtreecommitdiffstats
path: root/lib/public/util.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-09-22 15:03:28 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-09-22 15:03:28 +0200
commit814114ab8eda5d383f4c620f3854cfefcdb6895d (patch)
treee80442b93a34f22fa85cc6fbedd233954cd6f889 /lib/public/util.php
parentf4eae03f20674423cbe9034fdbeb30125157e6fc (diff)
downloadnextcloud-server-814114ab8eda5d383f4c620f3854cfefcdb6895d.tar.gz
nextcloud-server-814114ab8eda5d383f4c620f3854cfefcdb6895d.zip
enhance formatDate function to accept an optional argument containing the time zone
Diffstat (limited to 'lib/public/util.php')
-rw-r--r--lib/public/util.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/public/util.php b/lib/public/util.php
index 244c11ba2cc..35847fce38a 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -29,6 +29,7 @@
// use OCP namespace for all classes that are considered public.
// This means that they should be used by apps instead of the internal ownCloud classes
namespace OCP;
+use DateTimeZone;
/**
* This class provides different helper functions to make the life of a developer easier
@@ -167,10 +168,11 @@ class Util {
* formats a timestamp in the "right" way
* @param int $timestamp $timestamp
* @param bool $dateOnly option to omit time from the result
+ * @param DateTimeZone|string $timeZone where the given timestamp shall be converted to
* @return string timestamp
*/
- public static function formatDate( $timestamp, $dateOnly=false) {
- return(\OC_Util::formatDate( $timestamp, $dateOnly ));
+ public static function formatDate($timestamp, $dateOnly=false, $timeZone = null) {
+ return(\OC_Util::formatDate($timestamp, $dateOnly, $timeZone));
}
/**