The following code generates a Gaussian distributed random time (in hours, plus fractions of an hour) centered at a given point in time, and with a given standard deviation. Random times can wrap around the clock, especially if the standard deviation is a few hours: this is done correctly. Another “wrapping” algorithm may be more efficient if your standard deviations are very large (many days), but in any case the distribution will be almost uniform.
$peak=10;
$stdev=2;
$hoursOnClock=24;
do
{
$u=2.0*mt_rand()/mt_getrandmax()-1.0;
$v=2.0*mt_rand()/mt_getrandmax()-1.0;
$s = $u*$u+$v*$v;
} while ($s > 1);
$gauss=$u*sqrt(-2.0*log($s)/$s);
$gauss = $gauss*$stdev + $peak;
while ($gauss < 0) $gauss+=$hoursOnClock;
$result = fmod($gauss,$hoursOnClock);
echo $result;