duanlieshuang5330 2014-08-02 08:32
浏览 68
已采纳

PHP生成随机日期

I want a php script that generates random time:

For eg

first time : 2014-02-14 10:21:02 next time : 2014-02-14 08:21:02

only time changes date doesnot change.

  • 写回答

3条回答 默认 最新

  • dongyongan9941 2014-08-02 08:35
    关注

    You could do it with mt_rand() like this:

    echo date('Y-m-d')." ".mt_rand(0, 23).":".mt_rand(0, 59).":".mt_rand(0, 59);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?