Convert String To date in PHP
问题 How can I convert this string 05/Feb/2010:14:00:01 to unixtime ? 回答1: For PHP 5.3 this should work. You may need to fiddle with passing $dateInfo['is_dst'], wasn't working for me anyhow. $date = '05/Feb/2010:14:00:01'; $dateInfo = date_parse_from_format('d/M/Y:H:i:s', $date); $unixTimestamp = mktime( $dateInfo['hour'], $dateInfo['minute'], $dateInfo['second'], $dateInfo['month'], $dateInfo['day'], $dateInfo['year'], $dateInfo['is_dst'] ); Versions prior, this should work. $date = '05/Feb/2010