Quote:
Originally Posted by Trek
...*EDIT* - Ok, I've figured this out. I'll try to be clear, but... I think this is going to be confusing.
The problem is that my server time is in GMT, which is -8 from my time.
When I created the raffle, the only way I was able to get the dates to display correctly on the raffle portion people could see, was to set the draw date for a day LATER than I really wanted it to go. But on the raffle page, it looked like a date earlier than actually set.
So, I've been looking at the raffle page expecting it to draw, but when I edited it, then I saw that the draw date was in fact 7-03-2011, even though it was displaying 7-02-2011 on the raffle page.
So for now, I dropped the date back a day and now it's waiting to draw and I'll run the cron and it should do what it should of.
|
OK, let's see if I can explain this. It gets complicated so hang in there, there is a fix at the end.
First, this isn't a bug with setting the end date of the raffle.
When you set an end date, the program converts that date to it's proper Unix timestamp.
When it is displayed on the Raffle Edit page, it is displayed in it's originally entered format.
When it is displayed anywhere else, it is displayed in the date/time format chosen by the member viewing the raffle. (the same thing vBulletin itself does with date/time data)
Remember, the time displayed is NOT the time being used by vBulletin.
It is just a DISPLAY format. Not a data storage format. All times stored in the database are in your Servers time zone. Not in the time zone you chose to display as a user or the one used as the default display in vBulletin.
Scheduled Tasks use the
server's date/time to run. (this is a function of vBulletin, not the Raffle system)
So, in this case...
If you're in the Eastern time zone and you're server is -8 hours from your time zone, and you're expecting the raffle to draw at 10:00am your time. That will never happen with any Scheduled Task in vBulletin. The
server time hasn't reached the 10:00am time yet.
By editing the raffle, you actually did nothing to make the task run. The raffle was already waiting to be drawn at 10:00am
server time. Which was still somewhere near 8 hours away.
By running the task manually you did find a bug in the one line. But I'm not so sure it's as much a bug as it might be a PHP version difference. I say that because it runs without a hitch on PHP 5.2.4 and PHP 5.2.9 with or without the '$' in that line. Again, I'll remove the '$' from it for compatibilty sake in a release later today.
Back to the time problem and a possible fixes..
If you are on a dedicated server, the fix should be obvious. Change your server's time from your control panel (or via SSH) to match the time zone you want it to match. (may require a server reboot) And if you're using PHP 5.1 or later, you might also need to edit php.ini because it might be using a different time zone. (see first link below) It's as simple as that. But remember, members will see that date as it should be shown for their date/time display choice.
If you're on a shared server, there are a couple of possibilities...
1) If you use PHP 5.1.0 or later and have access to PHP.INI for your site, edit PHP.INI so it includes the date.timezone setting. See this page for more information..
http://www.php.net/manual/en/datetim....date.timezone
2) If you don't have access to PHP.INI and your PHP version is equal or greater than 5.0 you can TRY adding the date_default_timezone_set to vBulletin's config.php. MAKE IT THE FIRST ENTRY AFTER THE COPYRIGHT NOTICE. See this page for more information..
http://www.php.net/manual/en/functio...mezone-set.php
NOTE: Item 2 has not been tested. The worst thing that could happen is vBulletin would refuse to run and you would have to remove that new line from the config file.
3) If neither of those work, or your PHP version is prior to 5.0, you will need to live with the server time for Scheduled Tasks.