0

JFactory::getDate() doesn’t automatically add offset

Posted by Tim on December 7, 2009 in Open Source, PHP

By default, calling JFactory::getDate() doesn’t automatically apply the timezone offset.   The default date/time is GMT. By using the following code, you can set the offset from the global joomla configuration file <?php $thisJApp = &JFactory::getApplication(); $thisJDate = JFactory::getDate(); $thisJDate ->setOffset($thisJApp ->getCfg(‘offset’)); echo $thisJDate->toFormat(“%A %d %b %Y”); ?> If you want to set the date from [...]

Tags: ,

Copyright © 2008-2012 Codelab Blog All rights reserved.
Desk Mess Mirrored version 1.9.1 theme from BuyNowShop.com.