Adding number to date not working [closed]

your code is not working, because you use strtotime incorrectly… It should be used like this:

int strtotime ( string $time [, int $now ] )

But you pass formatted dated as first param, and another string as second one.

So how should it look like? Like so:

$addeddays = intval( get_user_meta($this->order->user_id, 'xxx', true) );
$timeBase = date('Y-m-d');
echo date('j.n.Y', strtotime( "+ {$addeddays} days", strtotime( $timeBase ) ));

Or a simpler version (since `$timeBase is today:

$addeddays = intval( get_user_meta($this->order->user_id, 'xxx', true) );
echo date( 'j.n.Y', strtotime( "+ {$addeddays} days" ) );