Skip to content

Commit

Permalink
Add "use" statment.
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Nov 7, 2016
1 parent 91aa335 commit 305f92b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/View/Widget/DateTimeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Cake\I18n\Time;
use Cake\View\Form\ContextInterface;
use DateTimeInterface;
use DateTimeZone;

class DateTimeWidget extends \Cake\View\Widget\DateTimeWidget
{
Expand Down Expand Up @@ -46,7 +47,7 @@ public function render(array $data, ContextInterface $context)
if ($val) {
if ($timezoneAware) {
$timestamp = $val->format('U');
$dateTimeZone = new \DateTimeZone(date_default_timezone_get());
$dateTimeZone = new DateTimeZone(date_default_timezone_get());
$timezoneOffset = ($dateTimeZone->getOffset($val) / 60);
}
$val = $val->format($type === 'date' ? 'Y-m-d' : 'Y-m-d H:i:s');
Expand Down

0 comments on commit 305f92b

Please sign in to comment.