in reply to Re^2: Datetime Problem - Wrong Time
in thread Datetime Problem - Wrong Time

FYI, if you want to use DateTime the way you were using it, there's clone:

#!/usr/bin/perl use DateTime; $dt = DateTime->now(); $month = $dt->clone->subtract(months => 1)->strftime("%m"); $year = $dt->clone->subtract(months => 1)->year(); print $dt."\n"; print $month."\n"; print $year."\n";