use DateTime; use DateTime::Format::Strptime; # string - input from user or something else my $time = '2009-11-30'; # Create a parser that can read YYYY-MM-DD Format my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d', time_zone => 'Europe/Berlin', ); # Parse the String my $dt = $parser->parse_datetime($time); # Subtract one Day $dt->subtract( days => 1 ); print $dt, "\n";