Lars' Tech Tips

Small things that make your life easier

Skip to: Content | Sidebar | Footer



Change the date format in Symfony with Propel

2 March, 2010 (01:28) | PHP, Symfony / Propel | By: Lars

You’ll usually want to have the same date format all over your Symfony / Propel project.

You only need to change one thing to do that:

In config/propel.ini:

propel.defaultTimeStampFormat = j M Y H:i
propel.defaultTimeFormat      = H:i
propel.defaultDateFormat      = j M Y

You can set the above format using PHP date() formatting.

After setting this run Symfony tasks propel:build-all (you may not need to reload the sql though) and cache:clear.

That’s all, enjoy!