1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-05-14 04:34:05 +02:00
Nextcloud-News/lib/Utility/Time.php
2016-07-23 21:24:54 +02:00

30 lines
696 B
PHP

<?php
/**
* ownCloud - 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 Bernhard Posselt 2016
*/
namespace OCA\News\Utility;
class Time {
public function getTime() {
return time();
}
/**
* @return int the current unix time in miliseconds
*/
public function getMicroTime() {
$utimestamp = microtime(true);
$timestamp = floor($utimestamp);
$milliseconds = round(($utimestamp - $timestamp) * 1000000);
$result = ($timestamp * 1000000) + $milliseconds;
return $result;
}
}