I was expecting gettimeofday would give me the number of seconds of the day. But if you access the "sec" index of the array it is identical to time() (so, unix timestamp, seconds since 1970).
So for others have to help them quicker, to get the number of seconds of the day, try this:
<?php
$t = time() % 86400;
?>