This could be done without heavy additions...
Each Adapter would just have to know it's specific date format.
f.e. $dateformat = "YYYY-MM-dd HH:mm:ss" for MySQL or "YYYY-MM-ddTHH:mm:ss" for MsSQL and so on...

Just add an issue to jira and it will be discussed within the dev-team.

Greetings
Thomas
I18N Team Leader


----- Original Message ----- From: "Tobias Gies" <[EMAIL PROTECTED]>
To: "Zend Framework General" <[email protected]>
Sent: Friday, September 21, 2007 3:44 PM
Subject: Re: [fw-general] Zend_Date and MySQL datetime


Hi list,

Before DB-specific code is added to the i18n components, why don't we do it the other way round and simply add about 5 lines of code in the abstract or concrete database adapters, to allow them to accept an instance of Zend_Date
as parameter for a query and simply turn it into the date format that best
fits the corresponding database?

just a thought.

Greetings,
Tobias

2007/9/20, Thomas Weidner <[EMAIL PROTECTED]>:

We can not integrate all just for fun...
The more we integrate the slower will Zend_Date work.

It would be no problem to have interfaces integrated for the best xx
databases. (mssql, mysql, oracle, postgres, dbm2, sqlite,...)
But this would mean to include about 100-200 new lines of code.
Because when we decide to add db-dependence code we should do it for all
db
formats and not only for mysql.

If you think it's worth doing feel free to add an jira issue and we will
discuss it in the dev-team.

Greetings
Thomas
I18N Team Leader


----- Original Message -----
From: "Dale McNeill" <[EMAIL PROTECTED]>
Cc: "Zend Framework General" <[email protected]>
Sent: Thursday, September 20, 2007 8:56 PM
Subject: Re: [fw-general] Zend_Date and MySQL datetime


> Thomas -
>
> It would certainly make sense to add an interface/constant to aid in
> getting a MySQL compatible string.  Seems like one of the more, if not
the
> most, common output usages.
>
> Dale
>
> Thomas Weidner wrote:
>> Hy,
>>
>> you are wrong...
>> The manual does not state that getIso() creates MySql Syntax.
>>
>> It is written that you can use all ISO formats as input for Zend_Date.
>> As there are over 50 different ISO formats it would be nonsense to
define
>> as much constants.
>>
>> But creating an non-standard Zend_Date output is also very easy...
>> Instead of getIso() just use
>> toString('YYYY-MM-dd HH:mm:ss');
>> and you have your self defined output.
>>
>> Greetings
>> Thomas
>> I18N Team Leader
>>
>> ----- Original Message ----- From: "Jack Sleight"
>> <[EMAIL PROTECTED]>
>> To: "Zend Framework General" <[email protected]>
>> Sent: Thursday, September 20, 2007 7:38 PM
>> Subject: [fw-general] Zend_Date and MySQL datetime
>>
>>
>>> Hi,
>>> The ZF manual states that for MySQL datetime values you can use the
>>> Zend_Date::ISO_8601 format, and the $date->getIso() method. It is >>> true
>>> that if you parse in a date from a MySQL field with the ISO 8601
format
>>> constant it will work, but strictly speaking they are not (correctly)
>>> ISO 8601 formatted. This becomes a problem when trying to save a date
>>> into the database, because the value returned by $date->getIso() is
not
>>> accepted by MySQL, and it throws an error (Incorrect datetime value:
>>> '2007-09-20T18:36:59+01:00'). The correct format for a MySQL datetime
>>> string is "YYYY-MM-dd HH:mm:ss".
>>>
>>> Could we add this as a new constant in Zend_Date?
>>> --
>>> Jack
>>
>
> --
> ------------------------------------------------------------------------
> Dale McNeill                  |
> Alchemy Systems               | phone: (512) 532-8050
> http://www.alchemysystems.com | email: [EMAIL PROTECTED]
> ------------------------------------------------------------------------




Reply via email to