# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: Joomla root # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. --- administrator/components/com_comprofiler/plugin.foundation.php +++ administrator/components/com_comprofiler/plugin.foundation.php @@ -3019,8 +3017,30 @@ * * @return string 'YYYY-MM-DD HH:mm:ss' */ - function dateDbOfNow( ) { - return date( 'Y-m-d H:i:s', $this->now() - ( 3600 * $this->getCfg( 'offset' ) ) ); + function dateDbOfNow( $time = true ) { + static $cache = array(); + + if ( $time ) { + $format = 'Y-m-d H:i:s'; + } else { + $format = 'Y-m-d'; + } + + if ( ! isset( $cache[$format] ) ) { + if ( checkJversion() >= 2 ) { + $timezone = date_default_timezone_get(); + + date_default_timezone_set( 'UTC' ); + + $cache[$format] = date( $format ); + + date_default_timezone_set( $timezone ); + } else { + $cache[$format] = date( $format, $this->now() - ( 3600 * $this->getCfg( 'offset' ) ) ); + } + } + + return $cache[$format]; } function setPageTitle( $title ) { if ( method_exists( $this->document->_cmsDoc, 'setTitle' ) ) {