Sackgesicht VIP
Total posts: 1,636
15 May 2013 01:27

It seems there are is an internal time problem with Cobalt 8.

My server's date is set correct, the joomla server time zone setting and user timezone as well.

If i edit a record, the checkout time is be wrong, it is is modified by the time difference from the server timezone.

I noticed this already with the status log.

Now when i checked the automated cron checkin, it will immediately checkin all records since the 30 min time interval becomes irrelevant.

Btw,

regarding the checkin function:

Everyone who knows that a system was done with cobalt can checkin the records anytime he wants through the url call. How about other more dangerous controller functions?

Last Modified: 02 Mar 2014


Sackgesicht VIP
Total posts: 1,636
15 May 2013 02:40

example for audit log problem..

the creation time in the table :

the display of these records in the audit log


Sergey
Total posts: 13,748
15 May 2013 07:17

Everyone who knows that a system was done with cobalt can checkin the records anytime he wants through the url call. How about other more dangerous controller functions?

There is nothing dangerous in this function. Even if user run this URL every second nothing will happen. It will not delete anything that should not be deleted unless errors like your date.

But anyway I added security system. you add secret word to Cobalt global configuration and then &secret=12345 to cron URL. This way you protect from illegal access to cron tasks.

Regarding dates I have made some changes lets look if it wil work.


Sackgesicht VIP
Total posts: 1,636
19 May 2013 06:34

Regarding dates I have made some changes lets look if it wil work.

No, still the same problem ...


Sergey
Total posts: 13,748
20 May 2013 06:11

Do you have any time offset adjustment in Joomla config?


Sergey
Total posts: 13,748
20 May 2013 06:14

Can you check if this 3 have the same value

echo date('Y-m-d H:i:s')

echo JFactory::getDate()->toSql();

echo JHtml::_('date', time(), 'd M Y h:i:s');


Sackgesicht VIP
Total posts: 1,636
20 May 2013 06:18

yes, as mentioned in the start topic, i have

1) correct server time (date/time settings of the computer)

2) in Joomla Server Location Settings -> the correct "Server Time Zone" and

3) correct Time Zone for user

All 3 settings represent actually the same time zone ...


Sackgesicht VIP
Total posts: 1,636
20 May 2013 06:24

echo date('Y-m-d H:i:s') --> 2013-05-20 19:20:48 (correct)

echo JFactory::getDate()->toSql(); --> 2013-05-20 11:20:47 (wrong)

echo JHtml::_('date', time(), 'd M Y h:i:s'); --> 20 May 2013 07:20:48 (assuming pm, correct)


Sergey
Total posts: 13,748
20 May 2013 07:16

Can you also add to this list

$db = JFactory::getDbo();

$db->setQuery('Select NOW()');

echo $db->loadResult();

I want to see if there is any difference in MySQL date and PHP.


Sackgesicht VIP
Total posts: 1,636
20 May 2013 12:24

2013-05-21 01:22:38 ok

2013-05-20 17:22:38 wrong echo JFactory::getDate()->toSql();

21 May 2013 01:22:38 ok

2013-05-21 01:22:38 ok


Sergey
Total posts: 13,748
21 May 2013 10:35

Unfortunately I can barely understand how those dates are working. I made some changes. It will not fix date difference but should fix checkin.

Date difference should be normal. It is like JFactory::getDate()->toSql() saves data in Universal date time and JHtml::_('date', time(), 'd M Y h:i:s'); applies Joomla config offset before display to show local time.


Sackgesicht VIP
Total posts: 1,636
22 May 2013 00:12

Date difference should be normal.

hmm ... there should not be any date/time difference, when server time and joomla server settings are both in the same timezone ..

the only time difference should come in, when a user is in a different time zone (but here all are in the same timezone)


Sergey
Total posts: 13,748
22 May 2013 04:52

If you want per user timezone it is only through user profile standard Joomla parameter.

I think this is right technique when you save all dates in DB with Universal time. And then adjust it's time on display. Then every use see his own correct time. The only problem with checkin was that I used different time. i have changed it to Universal time again.


hwdevteam VIP
Total posts: 76
19 Feb 2014 23:16

I have a serious issue with this:

2014-02-20 16:09:43 ( date('Y-m-d H:i:s') )

2014-02-20 05:09:43 ( JFactory::getDate()->toSql() )

2014-02-20 16:09:43 JHtml::_('date', time(), 'Y-m-d H:i:s')

2014-02-20 05:09:43 ( setQuery('Select NOW()') )

All those functions work fine (apart from daylight saving - which is only used by 'date()' not the db.. but that's ok..)

However Cobalt is adding 11 hours TO the publish date each time the record is saved.

Our web server is set to the timezone [Australia/Sydney] (GMT+10) and the Joomla AND User settings are also Australia/Sydney.

Cobalt saves incorrectly.

Eazyblog also saves incorrectly.

Joomla articles work perfectly.

I would suggest that Joomla 3.2 is causing this issue and that Cobalt needs to do what Joomla Content does - I will contact EasyBlog and let them know as well.

This seriously affects cron jobs where we organise records into categories, based on dates, and breaks auto-publish down and up dates.

Cheers,

Pete


Sergey
Total posts: 13,748
19 Feb 2014 23:36

Our web server is set to the timezone [Australia/Sydney] (GMT+10) and the Joomla AND User settings are also Australia/Sydney.

I believe that Joomla time zone is a correction offset off server time. I mean it does not know what is the time zone of server, just adds or subtract. I think server have to be UTC.

I'll check core Joomla articles and check what is the difference.


Sergey
Total posts: 13,748
20 Feb 2014 00:40

Joomla uses

$this->created = JFactory::getDate()->toSql(); 

to store dates and

JHtml::_('date', $this->created, 'Y-m-d H:i:s') 

to display.


hwdevteam VIP
Total posts: 76
20 Feb 2014 22:51

Sergey - did you fix this? - I haven't heard anything back from you - I thought you were looking into it ? Joomla content is fine, EasyBlog is now fine (after their patch).. Waiting for Cobalt.. My customer is ringing me about it a lot..


Sergey
Total posts: 13,748
21 Feb 2014 00:45

This is strange because that is exactly what we are using too.

Please check how it works if you do not affect Cobalt cadet with date-time field. May be problem is there.


Sergey
Total posts: 13,748
23 Feb 2014 01:46

you said you have datetime field that affect created time right? Can you unpublish this field and create article without it to see if that can be a problem?

because in Cobalt everything works just like in core content.


Sergey
Total posts: 13,748
24 Feb 2014 02:27

Ok, then check in special fields do you see date already added? What is you turn special field cor create date off?


hwdevteam VIP
Total posts: 76
24 Feb 2014 03:11

Hi Sergey, - Replys do not keep my formatting so added here..

We did a brand new vanilla install of Cobalt on a new server account. Nothing Custom.

Cobalt was installed. I posted a new record. On each save the 'Start from' jumped forward by 11 hrs

2014-02-25 02:11:02

2014-02-25 13:11:02

2014-02-26 00:11:02

2014-02-26 11:11:02

(On our production website that field is labelled 'Publish Date')

Cheers,

Pete

Powered by Cobalt