×

Notice

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

TOPIC: time problem

time problem 15 years 2 weeks ago #3044

  • reza
  • reza's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
hi
my comment time isn't correct with my local time?
can i change it?
in general configuration i set hour on local time and on 0:0 but no difference in result

time problem 15 years 1 week ago #3047

  • reza
  • reza's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
hi
i want to complete this topic
ok , someone in joomla farsi support sayed to me that give this zip file and extract file on
public_html/components/com_comment/joscomment/
and in the option on "The syntax used is identical to the PHP date() function.: option change to
l j F Y  H:i:s
every thing ok(dae) but with time i have problem yet.
server time is seted on 0:00 and in global configuration i set the time on my local time (+3:30 tehran)
but on comment time we have 2 hour soon. for example in local time 13:00 on comment time 15:00
can say to me how can i solve it? Fix.zip

time problem 15 years 1 week ago #3057

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, try the following.
Use the standard jocomment's files and not the files that oyu got from joomla farsi.

Go to public_html/components/com_comment/joscomment/utils.php

and find the function getLocalDate (around line 666)
	function getLocalDate($strdate,$format='Y-m-d H:i:s')
	{
		global $mainframe;
		return(date($format, strtotime($strdate)+($mainframe->getCfg('offset')*60*60)));
	}
change it to
	function getLocalDate($strdate,$format='Y-m-d H:i:s')
	{
        $conf =& JFactory::getConfig();
        jimport('joomla.utilities.date');
        $jdate = new JDate($strdate,$congi->getValue('config.offset'));
        $formatDate = $jdate->toFormat($format);
        return $formatDate;
	}

and please tell me if this solves your problem!

time problem 15 years 1 week ago #3064

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hm, sorry. There are 2 errors in the above code.
Replace the function with this here:
	function getLocalDate($strdate,$format='%Y-%m-%d %H:%M:%S')
	{
        $conf =& JFactory::getConfig();
        jimport('joomla.utilities.date');
        $jdate = new JDate($strdate,$conf->getValue('config.offset'));
        $formatDate = $jdate->toFormat($format);
        return $formatDate;
	}

then you can use the format of the strftime ( en.php.net/strftime ) to format the date as you wish.

When you are ready and everything is workin, make a banner of your web site and buy some impressions :)
compojoom.com/advertise.html

time problem 15 years 1 week ago #3137

  • reza
  • reza's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
hi
i upload the original util.php then make the change that you say and then on comment ,posting section i change the date format to Y-m-d H:i:s
but in comment we saw Y-m-d H:i:s instead of time and date
note:Because i want to solve the problem , re upload the original util.php but the time isn't correct

time problem 15 years 1 week ago #3140

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
you should use this syntax
%Y-%m-%d %H:%M:%S

and not Y-m-d H:i:s .
What do you mean with the time is not correct? It is not displaying at all, or it is wrong with several hours?

time problem 15 years 1 week ago #3180

  • reza
  • reza's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
hi
i do it,but except 15:00 the comment show 14:00

time problem 15 years 1 week ago #3186

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey, that is impossible :)
You have set the offset in the global configuration???
When I change the offset with +2 hours, then the date changes also with +2h.

I will need access to your installation to see it with my own eyes :)

time problem 15 years 1 week ago #3188

  • reza
  • reza's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 41
  • Thank you received: 0
hi
i use your last code
function getLocalDate($strdate,$format='%Y-%m-%d %H:%M:%S') 
    { 
        $conf =& JFactory::getConfig(); 
        jimport('joomla.utilities.date'); 
        $jdate = new JDate($strdate,$conf->getValue('config.offset')); 
        $formatDate = $jdate->toFormat($format); 
        return $formatDate; 
    }
and i use my local time in general configuration
ok,now what u want?
want a admin username and pass?
thanks

time problem 15 years 6 days ago #3192

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
just make on and pm it to me, ok?

time problem 14 years 11 months ago #3674

  • rudy
  • rudy's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Can you please tell me how this was fixed?
I am having the same issue.
My global configuration is set correctly, but the "Date Format" or timestamp for comments are ahead by 5 hours.

Thanks in advance!

time problem 14 years 11 months ago #3679

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
In joomlacomment alpha2 you should not have any problems with the date.

time problem 14 years 11 months ago #3684

  • rudy
  • rudy's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
I installed "!JoComment 4.0 alpha3" and definitely having the issue.
Is it possible that the code is broken again in this release?

I have not tried previous versions.
I saw this version and tried your product for the first time.

BTW, this is an excellent piece of software from what I have tested so far.
I don't anticipate a lot of posts early so, so I am only using the date and removed the time.
But I hope that you can have another look at the alpha 3 code.
OR, are you saying that I should downgrade to alpha 2?

Thanks,

Rudy

time problem 14 years 11 months ago #3685

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
May I get backend and ftp access to you installation?

time problem 14 years 11 months ago #3687

  • rudy
  • rudy's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
I sent you an email via your website to admin.
If that was incorrect, please let me know asap, cause I don't want that login info to get in the wrong hands.
I forgot to mention in the email.

Comments are enabled on the blog page.
So, on the front end, click on the blog menu and you will see 1 article.
Then click on the comments link (though this is likely obvious right?:)

Thanks,

Rudy

time problem 14 years 10 months ago #3984

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey there!
I only want to report about the status of the problem, because I got a mail from a user complained about the same thing.

I recognize that this is a bug:
dev.compojoom.com/issues/show/47

I got some feedback in joomla forum, and I believe that I can fix this bug :) For the moment I don't have the time or perhaps better - I'm not in the mood to fix bugs :)

After the 18th of may I will not work anymore and I will concentrate on fixing the bug and in the beta release this will be history!

Have a nice Sunday!
Daniel

time problem 14 years 10 months ago #4187

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey there!
Here you can have more info about the status of this :)
compojoom.com/blog/8-news/78-jdate-and-offset.html

Solved and coming with beta1 :)
  • Page:
  • 1
Time to create page: 0.145 seconds