Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> writes: > On May 13, Harry Putnam said: > >>Is there a date manipulation module that does the same thing as gnu >>`date -d' command? That is, given a spec string, it returns a date in >>the past in user selected format. >> >>Like what gnu `date' would do with: >> date -d '-2 weeks' +"%m%d%Y_%T" >> 04292004_13:20:28 > > You can use the standard (i.e. comes with Perl) POSIX module. It has a > strftime() function that behaves like C's does. Read the man page for > strftime and you'll have a pretty good idea how to use POSIX::strftime(). > > use POSIX 'strftime'; > > my $date = strftime "format string", localtime;
My question was regarding getting dates in past... Maybe I'm overlooking something obvious but a cruise thru `man strftime' hasn't unearthed a method to get past dates like gnu `date -d' can do. Ditto for perldoc POSIX -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>