[TYPO3-english] Difference empty dates and 1/1/70 date

Jigal van Hemert jigal at xs4all.nl
Thu Sep 16 10:14:22 CEST 2010


Hi,

On 16-9-2010 8:30, Xavier Perseguers wrote:
>>> Jigal van Hemert wrote:
>> Internally FLOW3 uses a PHP DateTime object (with a range of 10,000
>> BC - 10,000 AD), but when "persisting" the data it converts it to a
>> Unix timestamp to put it in an integer field.
>
> bad!

Karsten explained in the flow3.general list:

On 15-7-2010 16:38, Karsten Dambekalns wrote:
> Yes, we use getTimestamp() and setTimestamp() currently on the
> DateTime objects. That was the way of least resistance.
>
> As has been pointed out, the timestamp itself is not the problem,
> rather the range in which it is stored. We could switch to something
> better here, and probably will do in later, optimized backends.
> Currently the PDO backend with the scope of "pure ANSI SQL" cannot
> handle dates any better, at least that was my conclusion. Integers
> allow range queries on any database, timestamp can be set and
> retrieved reliably from DateTime, and we don't need any fancy type
> handling in the DB layer right now.
>
> I'm all in for optimizing this, but currently we didn't have further
> needs. As soon as start/end come into play for TYPO3 Phoenix that
> will probably change. :)
>
> If anyone compiles a list of date handling ways for various RDBMSs
> and a really good way to get/set something like DateTime::ISO8601 on
> DateTime objects regardless of the format the DB delivers I'd be
> happy. Talking about it, there was a lot of trouble in the way
> DateTimeZone and DateTime worked together, IIRC.
>
> Anyway, not being entirely happy with the current solution I am
> definitely open for something better! DateTime handling experts to
> the rescue!
>
> Regards, Karsten

> DATE/DATETIME datatype is supported by any decent DBMS. Timestamp are
> unfriendly when accessing the data directly (e.g, phpMyAdmin) and
> not being able to store a date < 1970 as of September 2010 seems
> really weird!

Maybe you can give some advice to the FLOW3 team regarding this? Even 
though FLOW3 is still in alpha state, the code is backported to Extbase 
and people are building extensions on that with the promise that it 
would be (relatively) easy to migrate them to FLOW3 packages. Leaving 
these unfinished ends until "later" will almost certainly end in:
- they will be forgotten
- they can't be changed any more when enough other code depends on it

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert
skype:jigal.van.hemert
msn: jigal at xs4all.nl
http://twitter.com/jigalvh


More information about the TYPO3-english mailing list