tedfroop wrote:
> First off - Boomx2, Thanks for your time and effort updating and
> maintaining the plugin.
>
> NHL Game times are not displaying correctly. My Time Zone is MST
> (offset in LMS is -02:00 Mountain) and tonight's Oilers / Canucks game
> is showing a 9:00pm start when it actually starts at 8:00pm. I don't
> know if its the same for all games but I will check tomorrows games.
> This showed up last year but I didn't have time to mess with it so I
> changed the offset to Pacific time zone after the Superbowl.
I'll take a look at this further tomorrow. In my initial review the
code looks correct. However, I may have an error in the calculations
for converting UTC time to Eastern time. I would have introduced the
error back in 2019 when I updated NHL scores to use a new data source.
The time converted correctly in my checks at that time. It might be
invalid to check for Daylight Savings Time. DST was in effect when I
last updated the NHL scores section of SDT.
If you're interested you can try tweaking the code in the SDT plugin.pm
file. Lines 5652 - 5672 from version 5-11-10 shown below is what needs
to be checked and adjusted.
Code:
--------------------
if ($game_time =~ /.+T(\d+)\:(\d+).+/) { #
Extract hours and minutes from UTC time
$StartHr = $1;
$StartMin = $2;
if ($isDST) {
$StartHr = $StartHr - 4;#
convert to Eastern time
}
else {
$StartHr = $StartHr - 5;
}
if ($StartHr < 0) { # check for
crossing to previous day
$StartHr = $StartHr + 24;
}
if ($StartHr > 12) { # convert
to 12 Hr format
$StartHr = $StartHr - 12;
$AmPm = 'PM';
}
elsif ($StartHr == 0) { # Midnight
$StartHr = $StartHr + 12
}
$clock_time = $StartHr . ":" .
$StartMin . ' ' . $AmPm;
}
--------------------
------------------------------------------------------------------------
BoomX2's Profile: http://forums.slimdevices.com/member.php?userid=33529
View this thread: http://forums.slimdevices.com/showthread.php?t=112122
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins