duannaiying9662 2010-04-22 12:53
浏览 102
已采纳

如何在php中将日期和时间转换为unix时间戳?

echo $_POST['time']."<br/>";
echo $_POST['day']."<br/>";
echo $_POST['year']."<br/>";
echo $_POST['month']."<br/>";

I have value store like this now I want to create a timestamp from these value. How to do that in PHP? Thanks in advance

  • 写回答

4条回答 默认 最新

  • dsi36131 2010-04-22 12:55
    关注

    You can use mktime(). Depending on the format of $_POST['time'], you split it into hour/min/sec and then use

    $timestamp = mktime($hour, $min, $sec, $month, $day, $year)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?