diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-02-13 22:13:11 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-02-13 22:13:11 +0300 |
commit | 10a528b3d6ff3dc3269f9d5d408caea1e52d3ed4 (patch) | |
tree | c4cacde4b4c245de853420c78124ac1a769ecef1 /core/Date.php | |
parent | 806bedba1a43d7d78b687d1d23a6b861a2b70035 (diff) |
refs #4633 rename segment filter to segment, fixed a bug re visitTime and extracted code into a filter
Diffstat (limited to 'core/Date.php')
-rw-r--r-- | core/Date.php | 21 |
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. |