Php随机日期时间

代码示例

8
0

php中的随机数生成器

you can use rand() function for that in php.
Example:
Generate random numbers between 1 to 50
<?php
  echo rand(1,50);
?>
0
0

php脚本生成随机日期

//Generate a timestamp using mt_rand.
$timestamp = mt_rand(1, time());

//Format that timestamp into a readable date string.
$randomDate = date("d M Y", $timestamp);

//Print it out.
echo $randomDate;

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................