2009年4月7日星期二

Re: [fw-db] Storing a Zend_Date in a Zend_Db_Table

On 6 Apr 2009, at 19:26, Hector Virgen wrote:

> Would it be a step in the right direction to include format
> constants for various db types?
>
> For example, $date->toString(Zend_Date::MYSQL_DATETIME) could
> produce '2009-04-06 11:24:37'

I don't think that type of thing belongs in the framework at all,
never mind as part of Zend_Date. If you start adding format strings
where do you stop?

As has been mentioned before, a unix timestamp is just about accepted
by most databases and tried and tested functions already exist for
converting it in just about every programming language I have come
across.

It has the added benefit of removing any timezone differences for you,
using string based dates does not.

Paul

没有评论: