如何将其转换为合适的时间戳?
$Year = "2011";
$Day = "7";
$Month = "3";
$Hour = "3";
$Minutes = "0";
$Seconds = "0";
/// How do I convert to right timestamp?
$dateToTimestamp = strtotime("$Month $Day $Year $Hour $Minutes $Seconds");
echo "$dateToTimestamp"; // NOT WORKING. Seconds are updating each refresh.
// They should be static from the var above.
答案 0 :(得分:3)
使用mktime
$dateToTimestamp = mktime($Hour, $Minutes, $Seconds, $Month, $Day, $Year);