php strtotime() 正确格式
php strtotime() proper format
如何将其转换为正确的时间戳?
$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.
使用mktime
$dateToTimestamp = mktime($Hour, $Minutes, $Seconds, $Month, $Day, $Year);
如何将其转换为正确的时间戳?
$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.
使用mktime
$dateToTimestamp = mktime($Hour, $Minutes, $Seconds, $Month, $Day, $Year);