function getFormattedDate($strdate, $format = 'd m Y') { jimport('joomla.utilities.date'); $user =& JFactory::getUser(); if ($user->get('id')) { $tz = $user->getParam('timezone'); } else { $conf =& JFactory::getConfig(); $tz = $conf->getValue('config.offset'); } // Given time $jdate = new JDate($strdate); $jdate->setOffset($tz); $date = $jdate->toISO8601(); return Date_Difference::getStringResolved($date); }