×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Time not shown and wrong

Time not shown and wrong 14 years 8 months ago #5435

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
Woo! JoomlaComment support in SuperActivity! =P


In regards to the server time, I have both .htaccess and PHP timezone offset change settings.

.htaccess:
SetEnv TZ Australia/Sydney


index.php of my Joomla template:
<?php
putenv("SetEnv TZ Australia/Sydney");
?>

You only need one but I put both there anyway just in case :P

I also tell Joomla to still use GMT+10 [Sydney] which I think is the same as the PHP method above anyway.

Time not shown and wrong 14 years 8 months ago #5477

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Chris,
Perhaps you can point me what to change in joomlacomment to store the date right? To be honest - I still don't understand what the problem is?

This is the function that shows and converts the date.
The date is stored just in the same way as the date in the article component.
	/*
	 * Function to display the Date in the right format with Offset
	 */
	function getLocalDate($strdate,$format='%Y-%m-%d %H:%M:%S') {
 
	    jimport('joomla.utilities.date');
	    $user =& JFactory::getUser();
 
//	    if we have an anonymous user, then use global config, instead of the user params
	    if($user->get('id')) {
		$tz = $user->getParam('timezone');
	    } else {
		$conf =& JFactory::getConfig();
		$tz = $conf->getValue('config.offset');
	    }
 
	    $jdate = new JDate($strdate);
	    $jdate->setOffset($tz);
	    $formatDate = $jdate->toFormat($format);
	    return $formatDate;
	}

Time not shown and wrong 14 years 2 months ago #8732

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
JoomlaComment does it fine - it stores the time/dates in the database as UTC just like it should. Joomla itself does the timezone adjustments, but Joomla 1.5 doesn't support Daylight Savings time - timezone must be manually changed in Global Config.

This thread is no longer related to recent versions of JoomlaComment. *Unstickied* *Locked*
  • Page:
  • 1
  • 2
Time to create page: 0.102 seconds