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.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/core/Date.php b/core/Date.php
index 63c6384729..a046f4e27a 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -154,6 +154,19 @@ class Date
}
/**
+ * Returns the current hour in UTC timezone.
+ * @return string
+ * @throws Exception
+ */
+ public function getHourUTC()
+ {
+ $dateTime = $this->getDatetime();
+ $hourInTz = Date::factory($dateTime, 'UTC')->toString('G');
+
+ return $hourInTz;
+ }
+
+ /**
* Returns the start of the day of the current timestamp in UTC. For example,
* if the current timestamp is `'2007-07-24 14:04:24'` in UTC, the result will
* be `'2007-07-24'`.
@@ -627,14 +640,6 @@ class Date
return $out;
}
- public function getHourInUTC()
- {
- $dateTime = $this->getDatetime();
- $hourInTz = Date::factory($dateTime, 'UTC')->toString('G');
-
- return $hourInTz;
- }
-
/**
* Adds `$n` days to `$this` date and returns the result in a new Date.
* instance.