[TYPO3-dev] It works! Storing non-UNIX dates

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Jun 23 15:30:39 CEST 2006


Ries van Twisk schrieb am 23.06.2006 14:16:

> I am not much of a typo3 core guru, would it be possible to extend the
> kickstarter
> with a real datatime instead of a integer. The real negative part of
> storing integer numbers
> is that you cannot put a timezone with the datatime. This is a huge
> negative if you want
> to create world wide events for example.

True, but 'date' and 'date_extended' as I currently looked at just
handle dates, no "time" information, so this is another pair of shoes.

> I do think that all serious database engines, even mysql for a change
> can store this information
> the correct way. I don't say we need to change in feature all int(11) to
> datatime stamp,
> but it would be great if we can extend the kickstarter and have a option
> for a real datatime
> storage instead of integer (in any form).

I agree that this might be good in future. But as it is, this has been
discussed since 2004 and nothing has changed since then. This is why we
need not just to discuss potential formats, but also provide some
working solutions. Maybe David (as he was the original initiator of the
thread about it back in 2004) can also contribute more on that, as he
seems to have the most know-how in this discussion.

> 2) Calculating with date integers is extremely differcult if you want to
> calculate with timezone in mind, functions do exist that can do that for you. With
> integers you need to write all functions yourself to handle that.
> consider a international conference call and I want to show on each
> computer (japan, holland, USA) the the left to the actual call. This
> is difficult when working with just integers.

While handling timestamps surely is something important and that can be
solved with human power, I don't think such scenarios are required by
most users that need to store date/times before 1970.

> again, I don't say we need to change current method, and I would love to
> see the current int method extended.
> I would just like to see typo3 doing real data/timestamps possible in
> extensions. I know the bigger companies
> are asking for such a thing (and want to move to a other RDBM then mysql
> aswell).

There are several components involved to get such a new "eval type"
working in TYPO3:

1) we need to have an API to work with such dates, in which case we
could use an already working API (include it in TYPO3-source) or create
some TYPO3-API for date/times (which might even be just a wrapper to
some pre-existing API). The advantage of the "adodb" stuff is that it's
already being shipped with TYPO3 4.0.0.

2) you have to specify how the data is to be stored in a DB-generic
format. I think this should be easy, at least in MySQL.

3) such field has to be "eval"uated by JavaScript (TCE-Forms) so that
the data entered by the user is converted into such a beast.

4) opposite from 3, from DB back to TCE-Forms, in PHP. This should use
the API of 1).

> I am a big fan of method 2:  date_extended For backwards compatibility
> reasons I think we have that covered,
> when I install extensions now it simply says I need version xxx.
> 
> When I would make any extension now, the closest thing I can test on is
> typo3 3.8.x
> But I would develop and test it around 4.0. I think for me it's fair to
> say non-tested
> on typo3 version 3.x so I don't see the date-extended as a con.
> I assume with the new type is a real date/time field instead of an integer.

Well, if the new type won't be integer, it won't work in 3.x and not
even in 4.0.0 at all, at least until someone develops an extension that
ports that stuff back into 3.x. :)

Thanks for your contribution, Ries! Let's see what else we have...

Cheers,
Ernesto




More information about the TYPO3-dev mailing list