Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Time.php
Go to the documentation of this file.
1 <?php
12 
13 class Time extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
14 {
18  protected $_date;
19 
25  public function __construct(
26  \Magento\Backend\Block\Context $context,
27  \Magento\Framework\Stdlib\DateTime\DateTime $date,
28  array $data = []
29  ) {
30  $this->_date = $date;
31  parent::__construct($context, $data);
32  }
33 
40  public function render(\Magento\Framework\DataObject $row)
41  {
42  $time = date('Y-m-d H:i:s', strtotime($row->getSitemapTime()) + $this->_date->getGmtOffset());
43  return $time;
44  }
45 }
__construct(\Magento\Backend\Block\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, array $data=[])
Definition: Time.php:25
render(\Magento\Framework\DataObject $row)
Definition: Time.php:40