[TYPO3-dev] Time issues - a proposal

Dmitry Dulepov [typo3] dmitry at typo3.org
Sat Oct 27 13:02:10 CEST 2007


Hi Masi!

Martin Kutschker wrote:
> I want to introduce a new variable to be used for access control. It 
> drops the seconds from the current time as access control doesn't use 
> seconds. The point is to give Mysql the chance to cache the query, which 
>  is nearly impossible with clauses like "endtime > 
> $GLOBALS['SIM_EXEC_TIME']".
> 
> $ACCESS_TIME = $EXEC_TIME - ($EXEC_TIME % 60);
> $SIM_ACCESS_TIME = $SIM_ACCESS_TIME;

Great idea! +1.

> And I want a new option to store all timestamps in UTC/GMT. Therefor 
> t3lib_div gets two new functions.

Fine with me too with condition that you keep local time as default option (for compatibility reasons).

What about shorter versions:

function getTime()    {
    return ($GLOBALS['TYPO3_CONF_VAR']['SYS']['useUTC'] ? gmtime() : time());
} 

function makeTime()    {
    $func = ($GLOBALS['TYPO3_CONF_VAR']['SYS']['useUTC'] ? 'gmmktime' : 'mktime');
    return call_user_func_array($func, func_get_args());
}

-- 
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs




More information about the TYPO3-dev mailing list