DateTime::createFromFormat in PHP < 5.3.0

后端 未结 5 558
甜味超标
甜味超标 2021-01-20 04:06

I\'m looking for a function identical to DateTime::createFromFormat but I need it to work in an environment running a version of PHP which is older than v5.3. Basically I ne

5条回答
  •  半阙折子戏
    2021-01-20 04:17

    You can use Zend_Date class from Zend Framework: http://framework.zend.com/manual/en/zend.date.html

    $date = new Zend_Date($string, $format);
    $timestamp = $date->get();
    

提交回复
热议问题