[TYPO3-mvc] DateTime and how it works ?

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri May 18 17:27:58 CEST 2012


Hi,

don't know if it is related, but who knows: DateTime objects are not
serializable with PHP 5.2, only starting with PHP 5.3 (see [1]). So if
you experience these problems in a PHP 5.2 environment, you might want
to try giving it a try with PHP 5.3, maybe it works. :)

Cheers,
Ernesto

[1] https://bugs.php.net/bug.php?id=41334

Toke Herkild schrieb am 07.05.2012 15:15:
> Hi all,
> 
> I've a model with a DateTime field:
> 
> /**
>  * Date1
>  *
>  * @param DateTime
>  */
> protected $date1
> 
> setDate1($date1){
> ...
> }
> 
> well you know the drill..
> 
> The thing is, If I create a new object, or update an existing, it all
> works fine and gets saved to the DB. converted from string to integer
> Timestamp.
> 
> Now when I fetch this object/model from the DB, the DateTime field is NULL.
> 
> I can live with that, if the field is absolutely NULL, but it isn't, if
> I add this model to a view, and use a f:format.date on the field I get
> the output I'd expect from the stored output in the DB. But I'd expect
> to get False as the DateTime object of the Field/property is NULL.
> 
> Any brilliant explanations ?
> 
> Regards,
> Toke Herkild



More information about the TYPO3-project-typo3v4mvc mailing list