[TYPO3-dev] Time issues - a proposal

Mario Matzulla mario.melanie at arcor.de
Tue Nov 13 19:47:50 CET 2007


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.

Regards,
Mario

> 
> Masi




More information about the TYPO3-dev mailing list