We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to automatic convert SQL TIMESTAMP to PHP DateTime Object in Mvc\Model?

How to automatic convert SQL TIMESTAMP to PHP DateTime Object in Mvc\Model?

You could use property get and set.



125.8k
Accepted
answer

Create an afterFetch() function in your model, and do some logic to translate the data.