Oh it subtracts twice!!! I just literally facepalmed.... Updated to:
#!/usr/bin/perl use DateTime; $dt = DateTime->now->subtract(months => 1); $month = $dt->strftime("%m"); $year = $dt->year(); print $dt."\n"; print $month."\n"; print $year."\n";
Works now! Thanks monks :D
In reply to Re^2: Datetime Problem - Wrong Time
by solarisfire
in thread Datetime Problem - Wrong Time
by solarisfire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |