Here is what I would need in a "tiebreaker" system for my pool. I would need a way to determine the winning player for a week if two or more players ended up with the same number of points for that week. A common way to do this is to have all players pick the
total number of points for the last game of the week. Then, if there is a tie, whoever picked the closest number for the total points for the last game of the week would be declared the winner.
Has anyone verified that the cutoff times are working to prevent pick changes after the date? I tried some tests today and can't seem to get it working. Perhaps it is just how I have the times setup. With this UTC thing and being based off the server time it
is a headache to figure out.
I have a test pool setup. "Week 2 (Closes on Monday, Aug 30 at 11:00 AM)" shows on the picks screen. It is still open and allowing picks. The server is on Pacific time so this time should now be passed. Any ideas?
I checked the entry in the DB table for the week cutoff and it shows: 8/30/2004 6:00:00 PM The XML was setup as: cutoffdate="2004-08-30T13:00:00-05:00" So as I understand it the cuttoff in the XML should be defined as 1:00PM EST, however it is not set properly
in the database as this should be the server time for the cutoff, which is in PST and therefore should be 10:00AM PST should it not, not 6:00PM Something is weird with how UTC is being used or I'm missing soemthing in how to preoperly set this up.
May have found a bug in the following code: Private Sub UpdateLabels(ByVal WeekName As String, ByVal WeekStartDate As Date, ByVal WeekCutoffDate As Date) Dim WeekText As String = WeekName Dim TimeZoneName As String If WeekStartDate > Date.Now Then WeekText
+= " (Starts on " & FormatDate(WeekStartDate.ToLocalTime, "dddd, MMM d") & ")" ElseIf WeekCutoffDate < Date.Now Then WeekText += " (CLOSED)" Else WeekText += " (Closes on " & FormatDate(WeekCutoffDate.ToLocalTime, "dddd, MMM d") & " at " & FormatTime(WeekCutoffDate)
& ")" End If lblWeekInfo.Text = WeekText lblWeekInfo.Visible = True If System.TimeZone.CurrentTimeZone.IsDaylightSavingTime(WeekStartDate) Then TimeZoneName = System.TimeZone.CurrentTimeZone.DaylightName Else TimeZoneName = System.TimeZone.CurrentTimeZone.StandardName
End If lblTimeZone.Text = "All times are " & TimeZoneName & " (" & System.TimeZone.CurrentTimeZone.GetUtcOffset(WeekStartDate).ToString & " UTC)" End Sub WeekStartDate > Date.Now Should be comparing the Date.Now to the local time, not the UTC time from the
DB field. This check needs to be done against the same timezone for both start and cutoff or it will be wrong comparison.
s2k, It looks like you found another bug related to the Universal Time changes. The following code fires on the page that shows the picks:
Private Sub EnableSubmit(ByVal CutOffDate As DateTime)
If (CutOffDate >= DateTime.Now) And IsPicker Then
cmdSubmitPicks.Visible = True
Else
cmdSubmitPicks.Visible = False
End If
End Sub
I'm pretty sure that I have to put
DateTime.Now.ToUniversalTime() instead of DateTime.Now. As an indicator of this, I'll bet you that your pool is closed once the UTC offset passes. That is, by tomorrow you won't be able to make picks for the Week 2 in your test pool. mike.
leiner
Contributor
3560 Points
710 Posts
Re: Pick'Em Sports Pool module released for free
Aug 25, 2004 05:07 PM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 25, 2004 10:52 PM|LINK
romort
Member
45 Points
9 Posts
Re: Pick'Em Sports Pool module released for free
Aug 26, 2004 07:51 PM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 12:17 AM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 10:49 AM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 10:50 AM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 06:33 PM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 06:57 PM|LINK
s2k
Contributor
2617 Points
527 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 07:01 PM|LINK
mm53bar
Participant
1570 Points
314 Posts
Re: Pick'Em Sports Pool module released for free
Aug 30, 2004 07:04 PM|LINK
Private Sub EnableSubmit(ByVal CutOffDate As DateTime) If (CutOffDate >= DateTime.Now) And IsPicker Then cmdSubmitPicks.Visible = True Else cmdSubmitPicks.Visible = False End If End SubI'm pretty sure that I have to put DateTime.Now.ToUniversalTime() instead of DateTime.Now. As an indicator of this, I'll bet you that your pool is closed once the UTC offset passes. That is, by tomorrow you won't be able to make picks for the Week 2 in your test pool. mike.