Am Dienstag 08 Januar 2008 17:31 schrieb Tobias Schlitt:
> Hi!
>
> On 01/08/2008 10:43 AM Thomas Koch wrote:
> > I know you'll hate me, but I've got another 2cents. ;-)
> >
> > I set up a db with a timestamp column (since DatabaseSchema supports it)
> > and wanted to use it in PO with the new date converter. Unfortunately for
> > me the converter accepts only time values as integer timestamps, but
> > MySQL returns strings like '2008-01-08 10:14:08'.
> >
> > I'd still love to use native timestamp columns because they are much
> > nicer to read, when you access the db directly. My suggestion is to have
> > two different datetime converters: one to int and one to timestamp.
> >
> > I could also write this additional converter, if you're allright with the
> > idea.
>
> Only that DatabaseSchema supports the "timestamp" column does not mean
> that we support in PersistentObject. Values of this datatype are not
> easily portable and it is generally discouraged to make use of it when
> writing portable applications. Therefore: Please use integer fields to
> store your date/time data.

Thanks for your answer.
One last attempt to change your mind:

* For this particular site I don't care about portability. So why don't allow 
timestamps, while warning the user in the docs about the issue?

* So far all DatabaseSchema handlers write timestamp as timestamp. Therefore I 
don't see the portability issue. Still I don't have experience with all those 
timestamp types in different dbs.

* One advantage of timestamps can't be simulated by int: The timestamp can 
default to now. When using int I have to give the now value in php space.

Regards,

Thomas
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to