in reply to Re: Adding to dates
in thread Adding to dates

just tried your solution simeon and the ourtput from $then was 1030012664? I need the output to be in the form of YY-MM-DD Thanks

Replies are listed 'Best First'.
Re: Re: Re: Adding to dates
by DamnDirtyApe (Curate) on Aug 08, 2002 at 15:43 UTC

    So, just to expand a little on simeon2000's answer:

    #! /usr/bin/perl use strict ; use warnings ; $|++ ; use constant WEEK => 60 * 60 * 24 * 7 ; my @later = localtime( time + ( WEEK * 2 ) ) ; my $fmt_date = sprintf "%04d-%02d-%02d", $later[5] + 1900, $later[4], $later[3] ; print $fmt_date, "\n" ; __END__

    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche