[TYPO3-core] RFC: #12652: Value Preview of empty timestamp shows "01-01-70 (-40 yrs) "

David Bruchmann typo3-team-core at bruchmann-web.de
Mon Dec 7 13:32:02 CET 2009


Hi Setffen,

Von:        Steffen Kamper <info at sk-typo3.de>
Gesendet:   Montag, 7. Dezember 2009 13:08:33
> in general i must say that timestamps are much more easy to handle in 
> code. You can calculate with timestamps very easy and you can format 
> these values to any format you need. Date values are better readable as 
> plain in DB view, but much more complicate to format or calculate, you 
> always have to convert them to timestamp again.
> 
> So i don't would change this in database.

Ok, this point has to be decided by the core-team I think.
I can point out problems and help to find a solution.

> 
> The only problem we have is the proper handling of "no date" as 0 is the 
> 01-01.1970. So NULL would be an option for empty value as it's used for 
> other types as well.
> 

As I read in the mySQL-manual ODBC can't handle 0000-00-00-Values and 
they are internally converted to NULL by MySQL.
This is an unclear type-handling (by mySQL / ODBC) and I think we should 
chose a stable solution because it seems to make more work than just 
changing the field-definitions in the SQL-Files.
(Many Extensions perhaps have to be changed too.)


>>> There will be a problem begins if you pass this value to JavaScript's 
>>> Date class. It does not accept negative time stamps. But this is a 
>>> rare case.
>>
>> I don't know much of the JS inside TYPO3, here Steffen perhaps is the 
>> professional to consult.
>> 
> 
> here we have a very good option now, as ExtJS adds a function to date: 
> date.format
> It works exactly like the php function, it also handles negative values.
> 

Perfect!

Best Regards
David


More information about the TYPO3-team-core mailing list