![]() |
Unsupported Operand date_helper.php Line 336 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Unsupported Operand date_helper.php Line 336 (/showthread.php?tid=18274) |
Unsupported Operand date_helper.php Line 336 - El Forum - 04-30-2009 [eluser]edwa5823[/eluser] Hello All, I searched the net as well as this forum and have been unable to find any mention of this issue (most likely because I am seeing it under fairly odd circumstances). It may not be CI related, but I haven't been able to pin it to anything else. I am doing some simple UTC conversions on an integer (coming from a MySQL table), and when I run my code through my browser it runs without a hitch. I am, however, attempting to run this specific controller method as a CRON. It doesn't matter whether I WGET, cURL, or just open a socket and pull the file I get the same error every time: Quote:<b>Fatal error</b>: Unsupported operand types in <b>/home/www/alpha.qualboard.com/system/helpers/date_helper.php</b> on line <b>336</b> Line 336 is a very simple line, it is in the gmt_to_local method: Code: $time += timezones($timezone) * 3600; This is about to drive me crazy, I have debugged everything I can think of, tried casting the arguments to (int), etc, etc but to no avail. Any help would be greatly appreciated--thanks in advance! Unsupported Operand date_helper.php Line 336 - El Forum - 05-04-2009 [eluser]edwa5823[/eluser] I hate to, but I am going to bump this--I still can't figure this one out and could really use a hand. This is a project for work and it is starting to hold up my time line. Thanks again for any help! Unsupported Operand date_helper.php Line 336 - El Forum - 05-04-2009 [eluser]xwero[/eluser] How do you call the gmt_to_local function? Unsupported Operand date_helper.php Line 336 - El Forum - 05-04-2009 [eluser]edwa5823[/eluser] Turns out I just needed a weekend away from the computer--the reason I was seeing it in CRON and not through HTTP wasn't due to the method used to call it, but instead due to the fact that my UTC wrappers were natively using session variables in the conversion. I just had to fake the session variable in my recipient loop during the CRON job and everything went smoothly. Let this be a lesson to any newbies out there (or any old guys like me that just forget once in a while)... Check your variables, and check them often--it could save your life. |