Skip to content
Advertisement

date_diff() expects parameter 1 to be DateTimeInterface, string given

They have the same format:

JavaScript

But I am getting this error:

date_diff() expects parameter 1 to be DateTimeInterface, string given

Advertisement

Answer

Because you are passing string whereas date_diff expects datetime object,

JavaScript

DEMO.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement