DateTime::createFromFormat in PHP < 5.3.0

后端 未结 5 506
甜味超标
甜味超标 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:22

    You can create a timestamp and then run it through date.. to create the timestamp you can do some explode on the string you get..

    $tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));
    echo "Tomorrow is ".date("Y/m/d", $tomorrow);
    

提交回复
热议问题