Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Adding to dates

by bobrobclob (Initiate)
on Aug 08, 2002 at 14:34 UTC ( [id://188595]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-16 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found