Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepereiradasilva committed Sep 3, 2016
1 parent 651d145 commit a570ba7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions libraries/joomla/date/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ public function __construct($date = 'now', $tz = null)
$date = is_numeric($date) ? date('c', $date) : $date;

// If now, add the microseconds to date.
if ($date === 'now')
{
$now = parent::createFromFormat('U.u', microtime(true), $tz);
$date = $now->format('Y-m-d H:i:s.u');
}
$date = $date === 'now' ? DateTime::createFromFormat('U.u', microtime(true))->format('Y-m-d H:i:s.u') : $date;

// Call the DateTime constructor.
parent::__construct($date, $tz);
Expand Down

0 comments on commit a570ba7

Please sign in to comment.