×

Notice

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

TOPIC: Time Zone issue

Time Zone issue 12 years 9 months ago #14979

  • Uzi Cohen
  • Uzi Cohen's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Hi :)

I have a problem with the time of the comments,
I need to change it to +1
How can I configure the clock?

I tried to change Joomla time zone but its not effecting the comments time.

Joomla version 1.7.3

Thanks a lot,
Uzi

Re: Time Zone issue 12 years 9 months ago #14982

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
The joomla time zone should be effecting the time of the comments. But also please make sure that you are not logged into your website when you look at the time. If you are logged in, we will take the timezone from your user profile.

Let me know if this solves the problem?

Cheers,
Daniel

Re: Time Zone issue 12 years 9 months ago #14983

  • Uzi Cohen
  • Uzi Cohen's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Hi Daniel,

its not effecting the comments, I tried to change time zone couple of times when I logged in/logged out its not effecting the comments at all.

it takes the record from the DB and showing it as is.

any idea ?

Re: Time Zone issue 12 years 9 months ago #14984

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Uzi,
Confirmed! The problem is with 1.7 most probably it is the same with 2.5 . I'll look what is wrong with this tomorrow and will give you a fix.

Have a good night!
Daniel

Re: Time Zone issue 12 years 9 months ago #14985

  • Uzi Cohen
  • Uzi Cohen's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Thanks a lot Daniel !
Good Night :)

Re: Time Zone issue 12 years 9 months ago #14987

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Uzi,
I still don't understand why this peace of code doesn't work, but I know what you need to do to fix it.
So go to components/com_comment/joscomment/utils.php
on line 592 you have this code
		$jdate = new JDate($strdate);
change it to:
		$jdate = new JDate($strdate, $tz);
And delete the next line:
$jdate->setOffset($tz);

Now it should show the comment with the proper timezone.
Cheers,
Daniel

P.S. If you are happy with the component and the quality of the support please leave a small review here:
extensions.joomla.org/extensions/contact...icles-comments/12259

Re: Time Zone issue 12 years 9 months ago #15109

  • Uzi Cohen
  • Uzi Cohen's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 20
  • Thank you received: 0
Hi Daniel sorry for the huge delay.

just wanted to update you:
yes its solved the problem for the logged out users but its not effecting the logged in users.

basically I comment the if ($user->get('id')) and its fine for me I don't need it.
//if ($user->get('id')) {
		//	$tz = $user->getParam('timezone');
		//} else {
			$conf = & JFactory::getConfig();
			$tz = $conf->getValue('config.offset');
		//}

Thanks again !

Re: Time Zone issue 12 years 9 months ago #15115

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Thanks for the feedback. I'll see why it doesn't work with the user timezone and will fix it in the next version!
Cheers,
Daniel

Time Zone issue 11 years 5 months ago #21179

  • Brecht Coene
  • Brecht Coene's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0
Hi,

This fix doesn't work anymore (joomla 2.5.11).
JDate setTimezone() allows to use now only DateTimeZone object.

My fix
$conf = & JFactory::getConfig();
$tz = $conf->getValue('config.offset');
 
$jdate = new JDate($strdate);
 
try {
  $tzObject = new DateTimeZone($tz);
  $jdate->setTimezone($tzObject);
} catch(Exception $e) {
  //echo $e->getMessage() . '<br />';
}

what's more
$formatDate = $jdate->toFormat($format);
must be
$formatDate = $jdate->toFormat($format, true);

I see something similar is described here compojoom.com/about/blog/entry/how-to-use-jdate
Hope it may be usefull also in new version of comments.

Time Zone issue 11 years 5 months ago #21184

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Online
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
CComment5 uses:
$formatDate = JHtml::_('date', $strDate, $format, true);

So it should be fine.
  • Page:
  • 1
Time to create page: 0.157 seconds