Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: How to subtract date by 1 day

by ikegami (Patriarch)
on Dec 13, 2007 at 15:08 UTC ( [id://656836]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use POSIX       qw( strftime );
    use Time::Local qw( timegm );
    ...
    print(strftime("%Y_%m_%d\n", 
       gmtime(timegm(0,0,0,$d,$m,$y) - 24*60*60)
    ));
    
  2. or download this
    use POSIX       qw( strftime );
    use Time::Local qw( timegm );
    ...
    ($d,$m,$y) = (gmtime(timegm(0,0,0,$d,$m,$y) - 24*60*60))[3,4,5];
    
    print(strftime("%Y_%m_%d_%H_%M_%S\n", $sec,$min,$hour,$d,$m,$y));
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-12-07 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (49 votes). Check out past polls.