R
ragtek
Guest
I'm having this code:
Sometimes the values are ok and sometimes it's +/-2h
Isn't the time the same, if i run the script and if the server runs the script (as cronjob)???
I've lost 7h of my wonderful life with this and it's still not working as it should
What i want to accieve is:
start => 20:00
end => 06:00
From the options
and then=>
get the timestamp for the startdate
get the timestamp for the enddate
compare these values with $now
(edit: it's because of the timezone, right? but how can i prevent this?)
can i create a "visitor copy of my user with the set timezone for the cronjob)
PHP:
$timeString = XenForo_Application::get('options')->ragtek_plns_time; // STRING "15:35-06:00"
$startTime = (mktime(substr($timeString, 0, 2), substr($timeString, 3, 2)) - 1) + XenForo_Locale::getTimeZoneOffset();
$endTime = (mktime(substr($timeString, 6, 2), substr($timeString, 9, 2)) - 1) + XenForo_Locale::getTimeZoneOffset();
$now = XenForo_Application::$time;
Sometimes the values are ok and sometimes it's +/-2h
Isn't the time the same, if i run the script and if the server runs the script (as cronjob)???
I've lost 7h of my wonderful life with this and it's still not working as it should
What i want to accieve is:
start => 20:00
end => 06:00
From the options
and then=>
get the timestamp for the startdate
get the timestamp for the enddate
compare these values with $now
(edit: it's because of the timezone, right? but how can i prevent this?)
can i create a "visitor copy of my user with the set timezone for the cronjob)