ho trovato questa funzione sul sito di php.net , e velida ma quando metto l offset del sito o user muore li perche ?
Codice PHP:
function GeteDateTime( $dateformat )
{
global $settings,$RCW ;
$timeline = time();
$usertimezone = $RCW['user']['usertimezone'];
$servertimezone = $settings['timezone'];
$localtimezone = iff( $RCW['user']['usertimezone'], $RCW['user']['usertimezone'],$settings['timezone'] );
if ( date("I") == 1 ){
if (substr($localtimezone, 0, 1) == '-')
{
$timeline -= timezone_offset_string($localtimezone );
}
$timeline += timezone_offset_string($localtimezone);
}
return date($dateformat, $timeline ) ;
}
function timezone_offset_string( $offset )
{
return sprintf( "%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( $offset % 3600 ) );
}