getTimestamp()); $dt = DateTime::createFromFormat('Y-m-d', $str2); $dt->setTime(0, 0, 0); var_dump($dt->getTimestamp()); ?> 2. [代码]#方案2(使用正则匹配) 3. [代码]执行结果 int(1410762332) int(1410710400)