logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

DateFormat day-of-year format bug: msg#00002

Subject: DateFormat day-of-year format bug
Nothing like a new year to find bugs!  There is a bug in 
DateFormat.pm -- it does not print leading zeroes.  Also, it is 
formatted as a string instead of a number.

Test program:
         use Log::Log4perl::DateFormat;
         my $format = Log::Log4perl::DateFormat->new("yyyy-DDD-HH:mm:ss");
         my $time = time();
        print $format->format($time), "\n";

=> 2007-  5-09:38:44

patch:

@@ -192,7 +192,7 @@
  ######################
      } elsif($first eq "D") {
          push @{$self->{stack}}, [7, sub { $_[0] + 1}];
-        return "%${len}s";
+        return "%0" . $len . "d";

  ######################
  #a - am/pm marker    #


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Robert Jacobson               ..........................
Flight Ops. Team        Solar Dynamics Observatory (SDO)
.............                             ..............


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>