I have a timestamp field (using the timestampable template) that I want formatted differently in the results for only one SELECT query. Is there a way to pass in a date/time format string in the Doctrine_Query::create() method? Or maybe there’s a way with ->setParams() or ->setOptions?
I could format the date in the View using Zend_Date, but there’s something in the back of my mind that doesn’t like that idea.
Not sure about the formating in the query, but I’d like to answer this part of your question :
Formating an output is precisely the job of the View, I think — and absolutly not the role of the database engine, nor the Model layer.
Moreover, what if you want your application to be internationalized / localized ? Date formats are not the same for every countries / languages ; and that different formating doesn’t have its place on the database layer either, I think : it’s purely a matter of output — a matter if View.