示例#1
0
 public function setUsingPgsqlValue($val)
 {
     if (is_null($val)) {
         return null;
     }
     $this->_parameterValue = \DateTime::createFromFormat("Y-m-d|+", "{$val} ");
     // Add a space to the date in order to satisfy + char
 }
示例#2
0
 public function setUsingPgsqlValue($val)
 {
     if (is_null($val)) {
         return null;
     }
     if (preg_match("/\\.[0-9]{1,6}\$/", $val)) {
         $this->_parameterValue = \DateTime::createFromFormat("Y-m-d H:i:s.u", $val);
     } else {
         $this->_parameterValue = \DateTime::createFromFormat("Y-m-d H:i:s", $val);
     }
 }
示例#3
0
 public function testSetUsingPgsqlValue()
 {
     $j = new DateTime(":test");
     $j->setUsingPgsqlValue('2015-09-03 23:12:35');
     $this->assertEquals(new \DateTime("2015-09-03 23:12:35"), $j->getParameterValue(), "Testing datetime decoding from postgres value");
 }