Problem - Set the right offset doesn't work

Joomla versions 2.5, 1.7 and 1.6 are all end-of-life since December 31st 2014 and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
Kubik-Rubik
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 241
Joined: Wed Aug 25, 2010 1:59 pm
Location: Karlsruhe - Germany
Contact:

Problem - Set the right offset doesn't work

Post by Kubik-Rubik » Thu Jan 13, 2011 1:01 am

Hello community,

I have some trouble to upgrade a plugin from Joomla! 1.5 to 1.6.

I need to set the right offset from the configuration.

In Joomla! 1.5 this works:

Code: Select all

$date = JFactory::getDate();
$date->setOffset(JFactory::getApplication()->getCfg('offset'));
$date->toFormat();
or

Code: Select all

$date2 = new JDate();
$date2->setOffset(JFactory::getApplication()->getCfg('offset'));
$date2->toFormat();
But in Joomla! 1.6 the output is always UTC, not the chosen offset in the configuration.

Can somebody help? Thank you in advance!
Cheers
Viktor

Kubik-Rubik Joomla! Extensions https://joomla-extensions.kubik-rubik.de
Former member of Joomla! Production Leadership Team, Security Strike Team and Bug Squash Team

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: Problem - Set the right offset doesn't work

Post by mcsmom » Thu Jan 13, 2011 10:02 am

You may want to watch this
http://www.theartofjoomla.com/home/9-de ... la-16.html

Here is the API for JDate in 1.6.
http://docs.joomla.org/API16:JHtml/date

I really would ask development questions on the development forums or the mailing lists.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Locked

Return to “Migrating and Upgrading to Joomla! 2.5”