Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Date.php')
-rw-r--r--core/Date.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Date.php b/core/Date.php
index 4f792200e2..1448c23826 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -710,6 +710,17 @@ class Date
}
/**
+ * Subtracts `$n` seconds from `$this` date and returns the result in a new Date.
+ *
+ * @param int $n Number of seconds to subtract. Can be less than 0.
+ * @return \Piwik\Date
+ */
+ public function subSeconds($n)
+ {
+ return new Date($this->timestamp - $n, $this->timezone);
+ }
+
+ /**
* Adds a period to `$this` date and returns the result in a new Date instance.
*
* @param int $n The number of periods to add. Can be negative.