Opened 7 years ago

Closed 6 years ago

#11124 closed Patch - Bug Fix (Fixed)

Perl bindings not UTC aware

Reported by: Robert Kulagowski Owned by: beirdo
Priority: minor Milestone: 0.26.1
Component: Bindings - Perl Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The perl bindings aren't making the necessary UTC / localtime adjustment.

diff --git a/mythtv/bindings/perl/MythTV.pm b/mythtv/bindings/perl/MythTV.pm
index cb0d055..c28f563 100644
--- a/mythtv/bindings/perl/MythTV.pm
+++ b/mythtv/bindings/perl/MythTV.pm
@@ -800,7 +800,7 @@ EOF
         }
     # Otherwise, format it as necessary.  We have to use MySQL here because
     # Date::Manip is not aware of DST differences.  Yay.  Blech.
-        my $sh = $self->{'dbh'}->prepare('SELECT FROM_UNIXTIME(?)');
+        my $sh = $self->{'dbh'}->prepare('SELECT CONVERT_TZ(FROM_UNIXTIME(?),"SYSTEM","UTC")');
         $sh->execute($time);    # Assumed to be a correct epoch time (in GMT)
         ($time) = $sh->fetchrow_array();
         $time =~ s/\s/T/;

Change History (1)

comment:1 Changed 6 years ago by Karl Egly

Milestone: unknown0.26.1
Resolution: Fixed
Status: newclosed
Type: Bug Report - GeneralPatch - Bug Fix

The code in question has been changed to work after the switch to UTC in [9ae09db3] as part of #11079.

Note: See TracTickets for help on using tickets.