Date time format incorrect

When I copy an existing record with a date/time (e.g. 10-03-2020 10:00) (format = dmYHi) I want to override that date with the current date/timestamp
(e.g. 15-04-2020 14:48). I do this with the following code in row_rendered:

if(CurrentPageID()==“add”) {
$this->datum1->EditValue=CurrentDateTime();
}

But then the date shows like 20-04-2015 14:48 so year and day are exchanged.
Any idea how to solve?

I found a solution myself:

I changed to
$this->datum1->EditValue=date(“d-m-Y H:i”, strtotime(CurrentDateTime()));

If there is a better solution, feel free to share :slight_smile:

You may remove “, strtotime(CurrentDateTime())”.