date_default_timezone_set("Europe/Copenhagen");
$t=time();
$nutid = (date("Y-m-d H:i:s",$t));
1664488230
echo $nutid; 2022-09-29 23:50:30
   
echo strtotime($nutid); 1664488230
$nynutid = (date("d-m-Y H:i:s",strtotime($nutid))); 29-09-2022 23:50:30
   
echo date("d-m-Y H:i:s",strtotime("2022-09-08 12:30:45"))); 08-09-2022 12:30:45
echo date("d-m-Y H:i:s",strtotime("08-09-2022 12:41:57"))); 08-09-2022 12:41:57
echo date("d-m-Y H:i:s",strtotime("02-04-2021 5:23:07"))); 02-04-2021 05:23:07