DRY up getTimestamp method.

parent e0af9279
......@@ -232,15 +232,16 @@ class DB
/**
* Convert from unix timestamp to timestamp
*
* @param int $time Unix timestamp
* @param int $time Unix timestamp (if null, current timestamp is used)
*
* @return null|string Timestamp if a time has been passed, else null
* @return string
*/
protected static function getTimestamp($time = null)
{
if (is_null($time)) {
return date('Y-m-d H:i:s', time());
if ($time === null) {
$time = time();
}
return date('Y-m-d H:i:s', $time);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment