php script to generate random date

Solutions on MaxInterview for php script to generate random date by the best coders in the world

showing results for - "php script to generate random date"
Kylie
17 Sep 2016
1//Generate a timestamp using mt_rand.
2$timestamp = mt_rand(1, time());
3
4//Format that timestamp into a readable date string.
5$randomDate = date("d M Y", $timestamp);
6
7//Print it out.
8echo $randomDate;