Hi there,
I'm currently trying to write a function that works on a 24 hour (obviously) day but it must run 4x the normal speed.
So as an example, hour: 22 will pass 4 times every day.
It doesn't need to work on a AM/PM basis but only hour 1-24.
This may sound strange but it is for a php-based RPG game which is why the day needs to run 4x quicker so that it doesn't bias a particular timezone in the world.
My dev function is this but it doesn't work correctly.
function zone_time_check()
{
global $db, $phpEx, $board_config;
$diff = (time() *4);
$hour = 1;
$sec_in_an_hour = 60 *60;
while($diff >= $sec_in_an_hour)
{
$hour++;
$diff -= $sec_in_an_hour;
}
return $hour;
}
This is probably going to be an easy fix but I think I've been looking at it for too long now to see where I'm erroring.
Thanks in advance!. :)