[Boston.pm] a question

dan moylan <[email protected]>
Newsgroups gmane.comp.lang.perl.perl-mongers.boston
Message-ID <20170129185153.GA25748@aldeberon>
in fiddling with a perl script to calculate the variable
dates dependent on the date of easter, using Time::Local, i
got the wrong answers for shrove tuesday 47 and ash
wednesday 46 days before easter.  this turned out to be what
appears to me as an anomoly in Time::Local at 20170313 where
the delta seconds between days was 3600 sec short.  a test
script then found a corresponding anomoly at 20171106 where
the delta seconds was 3600 sec long.  fwiw i attach the test
script.  have i missed something obvious?

#! /usr/bin/perl
# tsttme.pl
# created 170129 by jdm3
# revised 170129 by jdm3

  use strict;
  use Time::Local;

  my ($dlt, $dte, $tme, $tmepre, $mth, $Mth, $day, $year, );
  my (@dim, @mth, );

  $year = $ARGV[0];
  if (! $year) {
      printf ("enter the year, stupid.\n");
      exit (0);
  }

  @dim = qw (31 28 31 30 31 30 31 31 30 31 30 31);
  @mth = (0 .. 11);

  if ($year%4 == 0) { $dim[1] = 29; }
# printf ("feb: $dim[1]\n");

  $tmepre = &Time::Local::timelocal (0,0,0,31,11,$year-1901);
  foreach $mth (@mth) {
      foreach $day (1..$dim[$mth]) {
          $tme = &Time::Local::timelocal (0,0,0,$day,$mth,$year-1900);
          $dlt = $tme - $tmepre;
        # printf ("$year$mth$day -- $dlt\n");
          $day = sprintf ("%02d", $day);
          $Mth = sprintf ("%02d", $mth+1);
          if ($dlt != 86400) { printf ("$year$Mth$day -- $dlt\n"); }
          $tmepre = $tme;
      }
  }

##########################################################################

tia,
ole dan


j. daniel moylan
84 harvard ave
brookline, ma 02446-6202
617-777-0207 (cel)
[email protected]
www.moylan.us
[no html pls]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.