I need to get random time from today. I have tried using this
$today = date('YmdHi');
$startDate = date('YmdHi', strtotime('-0.5 days'));
$range = $today - $startDate;
$rand = rand(0, $range);
$smthing=$startDate + $rand;
return $smthing;
But it is not working correctly.
For example i want to generate todays date and whatever from it.
Expected output
2015:25:09 14:10:20
2015:25:09 08:12:26
2015:25:09 01:02:24