in reply to Re: Getting the Latest Date Issue
in thread Getting the Latest Date Issue

I can reverse it, but how could I get today's date to be printed as well, it is stating from tomorrow's date.

my @date_dd_to_r = reverse @date_dd_to; print "\n@date_dd_to_r\n";

Replies are listed 'Best First'.
Re^3: Getting the Latest Date Issue
by olus (Curate) on Jan 22, 2008 at 19:32 UTC
    You are starting with today's date and the first thing you do in your cycle is to add one day.

    To keep the cycle untouched, you should subtract one day to the initial ($year,$mon,$mday), so that the first iteration gives you today.
      If I do this
      ($year,$mon,$mday) = Add_Delta_Days($year,$mon,$mday,-1); the dates go backward, where else could I subtract to get today's date printed?
        You do that once before the for loop.
        Inside the loop all remains unchanged.