[TYPO3-dev] bug dbType for date before 01-01-1970

Xavier Perseguers xavier at typo3.org
Thu Sep 25 09:47:06 CEST 2014


Hi Ismaël,

> however, I don't store timestamp in the database but mysql date (better
> idea for birthday, cause I know unix timestamp can't be below 01/01/1970).
> 
> With mysql date and my TCA 'dbType' => 'date', I had a problem with
> display and save date.
> 
> Ex birthday in mysql field 1950-02-23
> Display date : 22-02-1950
> I click save button and
> then in mysql field 1950-02-22
> Display date : 21-02-1950
> ..

I remember someone changed my original logic to take the time zone into
account. I might have encounter the bug you describe once (don't
remember for sure) but I don't anymore since I stopped using native
datetime picker for birthday since the picker is not usable to pick
really old dates. I'm using a custom field now.

In fact, the original code (commit ccd6b9d) used date() to convert the
date to a timestamp for use with the date picker. Current code (commit
51918) is using gmdate():

https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/typo3/sysext/core/Classes/DataHandling/DataHandler.php#l942

Related to bug https://forge.typo3.org/issues/51918

Maybe the fix is valid for date/time native fields but not date fields?

Kind regards

-- 
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the TYPO3-dev mailing list