Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Yesterday Date

by Herkum (Parson)
on Feb 05, 2008 at 03:56 UTC ( [id://666194]=note: print w/replies, xml ) Need Help??


in reply to Re: Yesterday Date
in thread Yesterday Date

How can DateTime be too hard to figure out? Come on!
use DateTime; my $date = DateTime->new( month => 2, day => 4, year => 2008 ); print "Start Date: " . $date->mdy . "\n"; $date->subtract( days => 1); print "Yesterday's Date: " . $date->mdy . "\n"; while( $date->day_of_week > 5) { $date->subtract( days => 1); } print "Next weekday date is " . $date->mdy() . "\n";

See! Easy as pie, a cow pie even! :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found