Thanks. I wish I knew this before :(
On Tue, Nov 22, 2011 at 5:08 PM, Matthew Weier O'Phinney <[email protected]>wrote: > -- mbneto <[email protected]> wrote > (on Tuesday, 22 November 2011, 04:20 PM -0400): > > I've recently started to use sqlite for unit test my zf-based apps > instead > > of using the actual db. > > > > I've been facing a problem because the date format is different from the > > mysql date to the sqlite date column. So all my tests that relies on > dates > > stored in the database fail > > > > How did you guys solve this? > > I usually store two fields: timestamp and timezone. Those two pieces are > RDBMS-agnostic, and allow you to then seed PHP's DateTime, or the > equivalent in other languages. Additionally, being numeric, they can be > sorted and compared against easily. > > -- > Matthew Weier O'Phinney > Project Lead | [email protected] > Zend Framework | http://framework.zend.com/ > PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc > > -- > List: [email protected] > Info: http://framework.zend.com/archives > Unsubscribe: [email protected] > > >
