Question on Date Cutoff

Started by Fog, December 27, 2013, 01:40:36 PM

Previous topic - Next topic

Fog

In a my quest to modify a NFL pickems game to pit NASCAR Drivers vs NASCAR Drivers I've come across a slight issue.

It's the cutoff time.

NASCAR has Races on both Saturday and Sunday...

However NFL has most of it's games played on Sunday.

If there is a Saturday Race I get and error on the cutoff time because nothing is on Sunday.

I don't want to create a Saturday Cutoff for Sunday Races, I would prefer to make it work for both days.

This is the function code

function getCutoffDateTime($week) {
//get the cutoff date for a given week
global $db_prefix;
$sql = "select gameTimeEastern from " . $db_prefix . "schedule where weekNum = " . $week . " and DATE_FORMAT(gameTimeEastern, '%W') = 'Sunday' order by gameTimeEastern limit 1;";
$qryCutoff = mysql_query($sql);
if (mysql_num_rows($qryCutoff) > 0) {
$rstCutoff = mysql_fetch_array($qryCutoff);
return $rstCutoff['gameTimeEastern'];
}
die('Error getting cutoff date: ' . mysql_error());
}


I'm guessing it has something to do with the Sunday but is there a "ANYDAY" or "SAMEDAY" Code one can use?

or does that

$week need to be changed up?

Any help would be great.

Fog

I went and solved my own issue.

Changed %W to %x

then changed

'Sunday' to '2014'

it was a format issue not a display issue....I think I'm learning.