You'll want to use PHP's DateTime
class. You can construct the object with any date string, I used 2014-01-15
in my example. Then you can ::modify()
it and get the string by using ::format()
. Check the documentation for other formats, but I used Y-m-d
.
<?php
$date_string = '2014-01-15';
$date = new DateTime($date_string);
$date->modify('+20 days');
$date_string = $date->format('Y-m-d');
var_dump($date_string);
// string(10) "2014-02-04"
?>
If you get your date's string with the get_woocommerce_pdf_date()
function, you can integrate this like so:
<?php
$date = new DateTime($this->get_woocommerce_pdf_date($order_id,'ordered'));
// Modify and format the date object to your liking.