I get a string date variable out of an extension in WordPress and need to change it into a date variable with the format (Ymd) to enter it into another db.
Actually i get the value out of the WordPress ACF-Extension. This works, the format inside this field is d.m.Y (01.12.2019):
$task_deadline = get_field( 'task_deadline', $task_id );
Then i try to change the variable into a date variable. This is not working i always get the output 01.01.1970.
$task_deadline_date = date('d.m.Y',$task_deadline);
After that i would like to change the variable format to Ymd. This is not working:
$task_deadline_date_format = date('d.m.Y',$task_deadline);