I want to use the diff() function in PHP and i used the DateTimeImmutable(), the problem is the date and time that i want to differentiate is inside of my database, so i used a query to pull it out and i store it in the variable, my problem is I don’t know the correct syntax to make it work because it always showing error because i put the variable in the parameter of DateTimeImmutable()
i used echo to test it
New contributor
Erick Chavez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.