php 随机显示据今天30天内的任意一天

function randomDate() { 

    //echo date( "Y-m-d H:m:s", $newtime);
    //echo date("Y-m-d H:m:s", strtotime("+2 week 1 days 7 hours 5 seconds"));
    $begin = strtotime("now");  
    $end = strtotime("+1 Month");
    $timestamp = rand($begin, $end);  
    return date("Y-m-d H:i:s", $timestamp);
}
echo randomDate();

 

posted @ 2014-08-12 16:29  井哥  阅读(518)  评论(0编辑  收藏  举报

友情链接 哈尔滨seo 紫砂壶 虾米