From 0a069064b34f87271e2f3d99e4057bc2cf5c4ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C5=8Dan?= Date: Wed, 25 Feb 2026 22:18:21 -0700 Subject: [PATCH 1/2] fix: uncomment Indian Standard timezone (IST) Enable IST (Indian Standard Time, UTC+5:30) in the timezone table. Previously commented out without clear reason. Originally submitted as gbarr/perl-TimeDate#5 by @mcsnolte Co-Authored-By: mcsnolte --- lib/Time/Zone.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Time/Zone.pm b/lib/Time/Zone.pm index 2f3233f..f1a89b0 100644 --- a/lib/Time/Zone.pm +++ b/lib/Time/Zone.pm @@ -219,7 +219,7 @@ CONFIG: { # "it" => +3*3600+1800,# Iran "zp4" => +4*3600, # USSR Zone 3 "zp5" => +5*3600, # USSR Zone 4 - # "ist" => +5*3600+1800,# Indian Standard + "ist" => +5*3600+1800,# Indian Standard "zp6" => +6*3600, # USSR Zone 5 # For completeness. NST is also Newfoundland Stanard, and SST is also Swedish Summer. # "nst" => +6*3600+1800,# North Sumatra From dd5ffe6f9b23508c3c251d64a5ac1c804ecee7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C5=8Dan?= Date: Thu, 26 Feb 2026 09:08:37 -0700 Subject: [PATCH 2/2] rebase: apply review feedback on #52 --- t/cpanrt.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/cpanrt.t b/t/cpanrt.t index 8ffd9fa..48be76b 100644 --- a/t/cpanrt.t +++ b/t/cpanrt.t @@ -1,7 +1,7 @@ use Date::Format qw(time2str strftime); use Date::Parse qw(strptime str2time); -print "1..9\n"; +print "1..11\n"; my $i = 1; @@ -63,3 +63,19 @@ my $i = 1; print "not " unless $year_parsed_as == $target_year; print "ok ", $i++, "\n"; } + +{ # IST (Indian Standard Time) should resolve to UTC+5:30 + use Time::Zone; + + my $offset = tz_offset("ist"); + print "# tz_offset('ist') = $offset (expected 19800)\n"; + print "not " unless defined $offset && $offset == 19800; + print "ok ", $i++, "\n"; + + # Verify parsing a date with IST timezone + my $time = str2time("2024-01-15 12:00:00 IST"); + my $time_utc = str2time("2024-01-15 06:30:00 UTC"); + print "# str2time IST=$time UTC=$time_utc\n"; + print "not " unless defined $time && defined $time_utc && $time == $time_utc; + print "ok ", $i++, "\n"; +}