[TYPO3-mvc] [Extbase] Get tstamp / crdate right after persist

Claus Fassing claus at fassing.eu
Tue Jun 4 10:23:17 CEST 2013


Am 04.06.2013 10:00, schrieb Xavier Perseguers:
> The difference is 1370329766 - 1370329764 = 2 seconds which is ±
> related to the time Extbase takes to process your request.
> $GLOBALS['EXEC_TIME'] is set once at the beginning of the request by
> TYPO3 Core and then is used through the code, even if when the record is
> actually written to the DB some seconds have passed, meaning
>
> $dateTime = new DateTime('now')
>
> gives you the real value but
>
> $dateTime = new DateTime('@' . $GLOBALS['EXEC_TIME']);
>
> (or whatever way you use to reuse a timestamp)
>
> will give you what's actually used in DB.
>
> Hope this shed some light on the internals of TYPO3.

Yes definitely. Thank you for this additional information.
Thus I don't need to set the tstamp but just working with 
$GLOBALS['EXEC_TIME']) and everything is working as expected.
Good to know.

Regards Claus


More information about the TYPO3-project-typo3v4mvc mailing list