×

Notice

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

TOPIC: Time Display Problems

Time Display Problems 16 years 5 months ago #161

  • Granit
  • Granit's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
Hello.

First thank you for this great component.

To my problem. I have the right timezone config in my joomla config, but still the time wont show correct in comments.

How to fix this?

Thanks.

Time Display Problems 16 years 5 months ago #165

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
That is somehow strange. We are using the php date function so the date must be right.
May I see your web site and also get super admin access to it?

Time Display Problems 16 years 5 months ago #167

  • Granit
  • Granit's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
I have sent you a pm.

Time Display Problems 16 years 5 months ago #169

  • Granit
  • Granit's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
Did you find anything?

Time Display Problems 16 years 5 months ago #171

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I have the feeling that something is wrong with joomla, but I will need someone else to confirm it.
On this installation the time is +0 (I'm in germany) and the time was looking right.
I changed it to +1 (as it should be) and !joomlacomment made also the change - it addes +1 hour to the date. When I create an article - the date is wrong. I will need someone else to check that.

Time Display Problems 16 years 5 months ago #172

  • Granit
  • Granit's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
Ok, as i suspected then, that is was some problem with joomla and not the component.

I really hope you find some answers so we all can have a solution on this problems.

Time Display Problems 16 years 5 months ago #273

  • Granit
  • Granit's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
Have you come up with some solution on this?

I brought it up over att joomla commnunity, but all i got was that joomla didnt have nothing to do with this and that it must be the component that got errors.

But i find that very strange seens this problem accurs on several modules and components.

Time Display Problems 16 years 5 months ago #283

  • Ronildo Costa
  • Ronildo Costa's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 40
  • Thank you received: 0
I will test this problem in my blog... ok?

Time Display Problems 16 years 5 months ago #285

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
That will be nice!
Please give us a link to your results.

Time Display Problems 16 years 5 months ago #286

  • Ronildo Costa
  • Ronildo Costa's Avatar
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 40
  • Thank you received: 0
OH, I will try update my version tonight... because the version that I'm using in my blog is 3.20RC1-i.
But, if nothing changes about function date... dosent work, because I change the "Time Offset" in globals configuration, and the hour and time in comments, did not change.

Time Display Problems 16 years 5 months ago #289

  • Granit
  • Granit's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 0
This problem really gets me crazy.

My users whants to know what time a comment has been written and not only the date.

I cant figure out what it is that couses this f*****g problem.

Time Display Problems 16 years 4 months ago #370

  • Snoop
  • Snoop's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
Hi.
The Problem still occurrs. :(

I will describe what I could find out, maybe you have an idea what has been to be fixed:

Im using Joomla 1.5.4

First thing is: Joomla doesn't handle the time very well. It seems thqat joomla itself uses the linux timestamp or so. it doesn't use the php date() thingy! It cant. Because I have to set up in joomla currently UTC+2 (summertime) here for Germany so that all articles get the correct time. when it is winter, I have to set it UTC+1 and all articles written in summer are 1 hour "older"... okay that s**** but isnt really the problem of joomlacomment.

For a test I wrote a small php-script and uploaded it to my joomla docroot, named date.php ( if you like to test it too):
<html>
<head></head>
<body>
 
<?php
 
echo date("d-m-Y H:i:s");
echo "<br>";
echo date( "O" );
 
?>
 
</body>
</html>

It shows the date and Time and the UTC-offset that the webserver uses. Some webserver use UTC time not caring where they are located, there I guess they don't have this time-problem! But I set up my server running on local time and this is currently utc+2 and in winter utc+1. The time is updated by an ntp-server.
In joomla I have still to set the Timezone. So I guess (as said above) joomla doesnt use date() or just gets the timestamp, that is utc and recalculates the time with the offset-setting. I guess thats somehow okay because of compatibility to several php/server-Settings.
So now I also guessed !joomlacomment uses the date() function AND adds or deducts the offset extra. So as of on my server date() still provides the correct time, the addition of the offset is wrong.

So: If you like to do a workaround: Check with the above Script, if date() provides the current correct time. If so, you can do following:

open components/com_comment/joscomment/utils.php on Line 660 and 661 find:
global $mosConfig_offset;
return(date($format, strtotime($strdate)+($mosConfig_offset*60*60)));

and replace it with:
/*		
global $mosConfig_offset;
 return(date($format, strtotime($strdate)+($mosConfig_offset*60*60)));  // if date provides correct time, so no offset needs to be added!
*/
return(date($format, strtotime($strdate))); 

I'm used to leave the original code commented. Now I will take a look how joomla gets the time and possibly if it stores it in a variable that possibly !joomlacomment can get. So it could become more unified :D

Time Display Problems 16 years 3 months ago #830

  • Johan Larsson
  • Johan Larsson's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Hi,

I have a similar problem with the time, i.e. the time in the comments being one hour off (1 hour too fast).

Your solution SOLVES this problem (great!) - however I get an error message when erasing an old comment. It´s a pop-up saying "undefined", and then the screen doesn´t refresh (the comment is still there, although if you refresh the page it is actually deleted).

Is there a way to get this right, so that the error message "undefined" disappears and the page refreshes as it should?

Thanks!

Johan
  • Page:
  • 1
Time to create page: 0.120 seconds