Wednesday, 18 September 2013

PHP random date and multiple dates

PHP random date and multiple dates

I have a problem regarding randoming a PHP date like this 2013-09-18
12:30. I want to random 6 dates like that one for 6 users, so dates don't
mix (dates can be the same but time must be +/- few hours). To random date
i used:
<?php
echo date('Y-m-d', strtotime( '+'.mt_rand(0,31).' days'));
?>
and had success with it but i can random hours or minutes (seconds i don't
need). The page is for reserving appointments for patients and giving them
random therapy dates. I also have an eventCalendar to show dates.
P.S is it possible to input multiple dates like an array (date1, date2,
date3) and show in mysql table i always get 0000-00-00. Thanks in advance.

No comments:

Post a Comment