×

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 #5032

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
I cannot see the time when a comment was posted anymore.

For example here:

hirnschwund.net/spiele/274

Instead of the time, I see the following: d.m.Y - H:i:s :(

And I also think, that the time when a comment was posted, is stored wrong in the database, because I have CB Super Activity installed and when I post a comment, this reports back "commented 2 hours ago".

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

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
Is your Joomla global configuration set to the correct timezone? Also, do you have Server Time offset defined in the .htaccess or index.php file?

Also if you are using JoomlaComment 4, the latest Beta 1 fixed timezone bugs so make sure you are using the latest version :)

It must be a timezone error somewhere. With the d.m.Y - H:i:s problem, I don't really know about that sorry :( hopefully Daniel (the programmer) can reply soon and provide some better help for you.

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
I was able to show date and time with this date syntax that I entered in the backend and the module:

%d.%m.%Y - %H:%M


Now this is shown but I was right - the time is 2 hours different. I posted a comment at 19:00, but the comment system shows, that it was posted 17:00.

This is a bit strange, I haven't set any time offsets in Joomla, everything is set to 0.

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

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
OK, well in the Joomla backend try setting your timezone to +2:00 (or -2:00, which one is right? I'm bad with time :laugh: ) and see if that changes anything. I have mine set to +10:00 which is the timezone for Eastern Australia, and it shows the correct time here :)

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
It does not change anything. I still have 2 hours back in the past :(

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

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Ronny,
Would you check the following please. If you use beta1 here it is how the time zone works.
If you are anonymous user the comments are shown with the timezone settings in the configuration.php, but if you are logged in the time is shown with the timezone your profile has. So does your profile has 2h timezone?

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Yeah THIS works. If I set the timezone in the userprofile to UTC +2, the comments have the correct time.

But the global timezone is set to UTC 0, new users also get UTC 0 and I don't know if this affects any other components I use.

Am I able to set the timezone directly in Joomlacomment? I mean, all other components just work fine with the timezone setting I currently have ;)

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

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Ronny, as I already explained that is the way we work with the offset and if you think - this is the logical way to do the things.

If you have a website in USA, let us say that you have 6h difference with germany.

If I visit your site as unregistered user I will see your local time - 9 AM, but as soon as I log in everything will change to 15PM.

I think this is the right way to have the things done. Also look at the content extension, I believe it works on the same pricipe. You can have 0 in your configuration.php, but as soon as you log in than the date is going to change for this content item.

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
I don't have any option for unregistered users to post any comments. My server is located in Germany and I maintain a German community :) Its always set to the right time (offset 0) and my users don't need to set their own timezone in the profile.

I don't know why Joomlacomment needs an offset of 2, when all other components work right with offset 0, the Joomla core works right with offset 0 and the server time shows the correct german timezone which is offset 0.

Joomlacomment only works right with an offset of 2 which wouldn't even be correct IF my server would run at GMT. In Germany I normally would have set an offset of GMT+1 then.

If its only possible to set the correct time in the user profile which would do a lot of problems (no frontend changing ever intended, new users have offset 0 at standard etc...) then I maybe have to change to JComments.

But at first I will look into the code and see how you did that in the 3 series. There it worked right without this timezone problems ;)

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Solved my problem now.

utils.php

Before:
if($user->get('id')) {
		$tz = $user->getParam('timezone');
	    } else {
		$conf =& JFactory::getConfig();
		$tz = $conf->getValue('config.offset');
	    }

After:
if($user->get('id')) {
		$tz = 2;
	    } else {
		$conf =& JFactory::getConfig();
		$tz = 2;
	    }

Now it shows the correct time at every time :)

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

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Well, ok - this is working for you, but I don't understand why there is a problem with this.
We get the right tz from your config file so it should show the right time. I've spend so much time on this and it is really annoying to see that it is still not working.

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
It would make sense if it was working right. But somewhere the component "steals" 2 hours, it shouldn't do this. ;)

The solution I did now isn't even the final one, on the frontend the right times are shown now, but Joomlacomment still stores them wrong in the database. As a result I still have time problems in CB Super Activity.

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

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Ronny,
Would you do something for me. Would you post a new article, then post a new comment under that article. What are the times stored? Is joomlacomment wrong, or both times are right in the database, but joomlacomment shows it wrong after outputing?

Thanks in advance!

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
That's a good idea. :) I should have checked that first before complaining here :P

OKAY. MY FAULT. But now I am really confused:

I haven't shown the time in articles on the frontend, now I checked that and I see, that Joomla has the wrong timezone here.

I posted an article in Joomla at 13:00, Joomla shows 11:00. So Joomlacomment IS right and working the way you programmed it.

I just don't understand why all my components work fine and why Joomla steals me 2 hours with an offset of 0. But I think thats not longer a problem related to this bugforum ;)

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
I read a bit of documentation, and now I know that this is a bug of Joomla since version 1.0, because it cannot handle the summertime.

My servertime is set to the German time, Joomla SHOULD need UTC 0 then. But it seems that Joomla cannot get the correct timezone and it displays the Greenwich Meantime then. I have summertime here, so I have to set UTC2 as the correct timezone.

This works for the Joomla core, my articles are now published at the right time. But not for ALL components, some of them get their time from Joomla and some others directly from PHP. E.g. in UddeIM I had to set a difference of -2 now, to display the right time.

But I still have the problem (sorry for that^^). With my hack, the time is shown correctly in each comment, if I use the original utils.php, its two hours to early - and this even in the database WITH my hack.

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

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Ronny,
Thank you very much for the help! I made the topic sticky, so other users can find out what is wrong.
I was looking at the com_content component and made our component work in the same way.

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
One last question:

You store the dates in the database and the offset only changes its view in the frontend, not how its stored in the database, right? ;)

That would explain why Superactivity still shows a difference - it doesn't apply the offset.

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

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
What is Superactivity?

And yes, we store the date without any offset in the database and after that just add the offset to the stored date.

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

  • Ronny Schmatzler
  • Ronny Schmatzler's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
SuperActivity is a component, that shows friend updates on a Joomla community.

When someone writes a comment to a video or article, his friends see this on a News-Tab.

I have to thank you for your patience. :) I think my last problem will be solved by the developer of SuperActivity ;)

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

  • Chris
  • Chris's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
SuperActivity supports activities of a BIG number of components (50)!

Each component stores time differently, some store Joomla time, some server time, some Unix time, and some GMT time.

Because of this, SuperActivity converts all component-times to the same offset (Joomla offset), depending on the component. It does not hack into the components' source code or database tables, but does this into its own code.

Don't worry, I will fix the offset of the JoomlaComments to show correctly in the SuperActivity feed.

Best,
Chris
SuperActivity Developer
  • Page:
  • 1
  • 2
Time to create page: 0.162 seconds