From 46b4dfe0ba54096d959ab758598937e8e6a7a481 Mon Sep 17 00:00:00 2001 From: Steve Rogerson Date: Tue, 18 Apr 2023 17:21:59 +0100 Subject: [PATCH] Remove support for old version (per-8.4) of postgresql --- lib/DateTime/Format/Pg.pm | 20 -------------------- t/tz_1901_2038.t | 24 ------------------------ 2 files changed, 44 deletions(-) delete mode 100644 t/tz_1901_2038.t diff --git a/lib/DateTime/Format/Pg.pm b/lib/DateTime/Format/Pg.pm index 088d83c..f563ef7 100644 --- a/lib/DateTime/Format/Pg.pm +++ b/lib/DateTime/Format/Pg.pm @@ -340,26 +340,6 @@ sub _fix_timezone { $args{'parsed'}->{'time_zone'} = $param{'_force_tz'}; } - elsif(!defined($args{'parsed'}->{'time_zone'})) { - # For very early and late dates, PostgreSQL always returns times in - # UTC and does not tell us that it did so. - # - if ( $args{'parsed'}->{'year'} < 1901 - || ( $args{'parsed'}->{'year'} == 1901 && ($args{'parsed'}->{'month'} < 12 || $args{'parsed'}->{'day'} < 14) ) - || $args{'parsed'}->{'year'} > 2038 - || ( $args{'parsed'}->{'year'} == 2038 && ($args{'parsed'}->{'month'} > 01 || $args{'parsed'}->{'day'} > 18) ) - ) { - $args{'parsed'}->{'time_zone'} = DateTime::TimeZone::UTC->new(); - } - - # DT->new() does not like undef time_zone params, which are generated - # by the regexps - # - else { - delete $args{'parsed'}->{'time_zone'}; - } - } - # Numerical time zone # diff --git a/t/tz_1901_2038.t b/t/tz_1901_2038.t deleted file mode 100644 index f8a8cb6..0000000 --- a/t/tz_1901_2038.t +++ /dev/null @@ -1,24 +0,0 @@ -# $Id: tz_1901_2038.t 1039 2003-05-30 14:04:49Z cfaerber $ -use Test::More tests => 4; -use DateTime 0.10; -use DateTime::TimeZone 0.12; -use DateTime::Format::Pg 0.02; - -# 2038-01-18 23:59:59+00 -# 2038-01-19 00:00:00 -# 1901-12-14 00:00:00+00 -# 1901-12-13 23:59:59 - -my $dt; - -$dt = DateTime::Format::Pg->parse_timestamptz('1901-12-13 23:59:59'); -ok($dt->time_zone->is_utc); - -$dt = DateTime::Format::Pg->parse_timestamptz('2038-01-19 00:00:00'); -ok($dt->time_zone->is_utc); - -$dt = DateTime::Format::Pg->parse_timestamptz('1901-12-14 00:00:00'); -ok($dt->time_zone->is_floating); - -$dt = DateTime::Format::Pg->parse_timestamptz('2038-01-18 23:59:00'); -ok($dt->time_zone->is_floating);