Skip to main content
3 of 3
added 65 characters in body
Farahmand
  • 2.3k
  • 1
  • 16
  • 28

Open the file /libraries/joomla/factory.php and search for getDate() function:

public static function getDate($time = 'now', $tzOffset = null)

The default value of time zone offset ($tzOffset) is null and not 0. It may be due to a mistake in Joomla documentation or it's for versions older than 2.5.

In Joomla 3, $date_zero_offset = JFactory::getDate('now', 0); raises an error:

DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given

So for Canary Islands, you can use this:

$date_zero_offset = JFactory::getDate('now', 'Atlantic/Canary');
Farahmand
  • 2.3k
  • 1
  • 16
  • 28