Opened 14 years ago
Closed 13 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 by , 13 years ago
| Milestone: | unknown → 0.26.1 |
|---|---|
| Resolution: | → Fixed |
| Status: | new → closed |
| Type: | Bug Report - General → Patch - Bug Fix |
Note:
See TracTickets
for help on using tickets.

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