|
|
@ -585,19 +585,19 @@ Class Common { |
|
|
|
$date = ''; |
|
|
|
$date = ''; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
preg_match('/^.*(\d{13}).*$/', $str, $matches); //单位毫秒的时间戳 |
|
|
|
preg_match('/^.*(\d{4}[012]{2}\d{2}).*$/', $str, $matches); //尝试Y-m-d格式的日期 |
|
|
|
if (empty($matches[1])) { //再尝试单位秒的时间戳 |
|
|
|
if (empty($matches[1])) { //再尝试单位秒的时间戳 |
|
|
|
preg_match('/^.*(\d{10}).*$/', $str, $matches); |
|
|
|
preg_match('/^.*(\d{10}).*$/', $str, $matches); |
|
|
|
if (empty($matches[1])) { //再尝试Y-m-d格式的日期 |
|
|
|
if (empty($matches[1])) { |
|
|
|
preg_match('/^.*(\d{4}[012]{2}\d{2}).*$/', $str, $matches); |
|
|
|
preg_match('/^.*(\d{13}).*$/', $str, $matches); //单位毫秒的时间戳 |
|
|
|
if (!empty($matches[1])) { |
|
|
|
if (!empty($matches[1])) { |
|
|
|
$date = date('Y-m-d', strtotime($matches[1])); |
|
|
|
$date = date('Y-m-d', (int)$matches[1] / 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
$date = date('Y-m-d', (int)$matches[1]); |
|
|
|
$date = date('Y-m-d', (int)$matches[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
$date = date('Y-m-d', (int)$matches[1] / 1000); |
|
|
|
$date = date('Y-m-d', strtotime($matches[1])); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}catch(Exception $e) {} |
|
|
|
}catch(Exception $e) {} |
|
|
|