//1、时间戳转日期格式
function timestampToDate($timestamp) {
$datetime = new DateTime("@$unixtime");
$datetime->setTimezone(new DateTimeZone('PRC'));
return $datetime->format("Y-m-d H:i:s");
}
//2、日期格式转时间戳
function dateToTimestamp($date) {
$datetime= new DateTime($date, new DateTimeZone('PRC'));
return $datetime->format('U');
}