Hi! On 01/09/2008 08:31 AM Thomas Koch wrote: > Am Dienstag 08 Januar 2008 17:31 schrieb Tobias Schlitt:
>> 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. If we would add support for timestamp fields in PersistentObject, we would need to take care about all the different formats of different RDBS. Trust me, there are lots of differences. The solution is: Just don't use it. For your case it should be easy to write a converter on your own and use this one. This is the advantage of OOP and interfaces. > * 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. This is true, but not a problem. :) Regards, Toby -- Mit freundlichen Grüßen / Med vennlig hilsen / With kind regards Tobias Schlitt (GPG: 0xC462BC14) eZ Components Developer [EMAIL PROTECTED] | eZ Systems AS | ez.no -- Components mailing list [email protected] http://lists.ez.no/mailman/listinfo/components
