This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Timezones in Symfony 1.4 using Propel (1.5)

Discussion relating to version 1.3.x and 1.4.x

Timezones in Symfony 1.4 using Propel (1.5)

by gmaddock » Thu Mar 05, 2015 11:22 pm

I'm looking for some guidance to adding timezone handling to a Symfony 1.4 application that previously has not had any. What are the best practices? Is there a good guide or example app that implements time zone handling?

My specific situation...

I'm working on a moderately mature app that uses the Symfony 1.4 framework with MySQL database backend that uses Propel 1.5.

The app is a CMS that handles customer tickets, and thus requires lots of timestamping and date handling. To this point, we have been using datetime fields for storing dates, which does not preserve the timezone. We have an assumed default timezone of "America/New_York", and the whole company exists in this timezone (until now), so it hasn't been an issue.

I initially added user configs that lets the user set an alternate timezone for their location, and a helper function that gets that timezone and applies it to any date to output that date. That works for displayed dates.

I'll also need to override form widgets that use times, and before I start over-riding them on my own, I'm wondering if there isn't a better existing method to achieve this.
gmaddock
Junior Member
 
Posts: 6
Joined: Fri Feb 11, 2011 6:24 pm