I was trying to find a php function to generate a random date in selected date range. And then I found out some handy functions about generate date. 1st Generate New Date with Various Conditions (Specific or Random) based on Today’s Date The function will be as following: function getOtherDate($format, $fromNow){ return (date($format, strtotime($fromNow, strtotime(date($format))))); } There are two parameters. One is $format, which is the date format in php. For example, “Y-m-d H:i:s”. The other is $fromNow, which is a descriptive string to add/minus days, weeks, months, years and etc. The...
Read More