Slightly strange question, but hopefully someone can help.
In essence, if the time was 12pm the the elapsed percentage would be 50%, 6am would be 25% and 16pm would
gettimeofday(true) returns the number of seconds elapsed since midnight as a float (I think), so you want: gettimeofday(true)/(60*60*24)
. Multiply by 100 to get a percentage.
EDIT: Actually, gettimeofday returns the number of seconds elapsed since the start of the epoch, so you need to subtract midnight:
$midnight = strtotime('00:00');
$epochseconds = gettimeofday(true);
$timeofdayseconds = $epochseconds - $midnight;
$timepercent = $timeofdayseconds/(60*60*24)*100;