1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2024-12-22 14:42:47 +01:00
Nextcloud-News/lib/Utility/Time.php
Sean Molenaar 49c6f7077d Define microtime as string
Closes #835

Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
2020-10-05 09:47:44 +02:00

30 lines
600 B
PHP

<?php
/**
* Nextcloud - News
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright 2016 Bernhard Posselt
*/
namespace OCA\News\Utility;
class Time
{
public function getTime(): int
{
return time();
}
/**
* @return string the current unix time in miliseconds
*/
public function getMicroTime(): string
{
list($millisecs, $secs) = explode(" ", microtime());
return $secs . substr($millisecs, 2, 6);
}
}