[TYPO3-dev] Time issues - a proposal

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Nov 14 14:39:49 CET 2007


Mario Matzulla schrieb:
> Hi Masi,
> 
> Martin Kutschker schrieb:
>> Here's a proposal I sent on typo3.dev:
>>
>> Martin Kutschker schrieb:
>>>
>>> And I want a new option to store all timestamps in UTC/GMT. Therefor 
>>> t3lib_div gets two new functions.
>>>
>>> function getTime()    {
>>>     if ($GLOBALS['TYPO3_CONF_VAR']['SYS']['useUTC'])    {
>>>         $time = gmtime();
>>>     } else {
>>>         $time = time();
>>>     }
>>> }
>>>
>>> function makeTime()    {
>>>     $args = func_get_args();
>>>
>>>     if ($GLOBALS['TYPO3_CONF_VAR']['SYS']['useUTC'])    {
>>>         return call_user_func_array('gmmktime', $args);
>>>     } else {
>>>         return call_user_func_array('mktime', $args);
>>>     }
>>> }
>>
>> The idea is that TYPO3 runs either backwards compatible with local 
>> time or in UTC for new installations.
>>
>> The Core and all compliant extensions MUST use these two new functions 
>> so that timestamps are generated in a consistent way across the system.
> 
> I'm not sure about these functions. I think it's an enhancement, but it 
> doesn't really solve the problem: date & time fields are generated 
> through a client-side javascript - where you don't know the timezone. 
> That's why we FIRST want to change the javascript to return only UTC 
> times and THAN we can talk on how we handle time on the server-side.

The functions are needed for backwards compatibility. Currenty TYPO3 uses 
the local TZ on the server side. So all EXISTING database entries are made 
with that. In a new installation you can use UTC for storage. My propsoed 
functions make only sure  you get the time in the expectd format: local or UTC.

Masu

Masi




More information about the TYPO3-dev mailing list