Xhgui_Profile::getDate PHP Method

getDate() public method

public getDate ( )
    public function getDate()
    {
        $date = $this->getMeta('SERVER.REQUEST_TIME');
        if ($date) {
            return new DateTime('@' . $date);
        }
        return new DateTime('now');
    }

Usage Example

Example #1
0
 public function testGetDateFallback()
 {
     $data = array('meta' => array('SERVER' => array()));
     $profile = new Xhgui_Profile($data);
     $result = $profile->getDate();
     $this->assertInstanceOf('DateTime', $result);
 }