Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Date Time problem.

by markkawika (Monk)
on Sep 04, 2009 at 17:47 UTC ( [id://793530]=note: print w/replies, xml ) Need Help??


in reply to Date Time problem.

Consider using DateTime.

use strict; use warnings; use DateTime; my $dt = DateTime->now; $dt->subtract( days => 1 ); my $curLogDate = $dt->year . '0' . $dt->mon . '0' . $dt->mday;

Replies are listed 'Best First'.
Re^2: Date Time problem.
by ikegami (Patriarch) on Sep 04, 2009 at 19:02 UTC
    While you copied the OP's behaviour of using "...012025" for Christmas, he probably wants "...1225".
    my $curLogDate = $dt->ymd('');

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-09-09 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.