Elxis CMS Forum

Support => General => Topic started by: wbread on November 28, 2014, 14:48:38

Title: problem with a publication date
Post by: wbread on November 28, 2014, 14:48:38
On Elxis 4 faced with such a problem. when editing the pages, publication date goes astray on 1 January 2014 each time. each time it has to change. what could be wrong?
Title: Re: problem with a publication date
Post by: datahell on November 28, 2014, 20:58:32
Your Elxis behaves absolutely normal and correctly. The publication date has meaning only on non-published articles that have been scheduled to be published in the future. "2014-01-01" is used as a check date.  If you set the article as published then the publication date is set to 2014-01-01. Any date in the past is OK but we picked that date as default. Also that date is set to the default "2014-01-01" in case it is empty or invalid.

Do this test to understand how it works:

Set the article unpublished and publication date to any date in the future, eg 2014-12-15, save the article. Your choice for the publication will remain date. If you publish the article the publication date will be reset automatically back to the default 2014-01-01
Title: Re: problem with a publication date
Post by: wbread on November 29, 2014, 13:02:51
The problem is - when I try to save an article gives me an error that the date is not correct
Title: Re: problem with a publication date
Post by: datahell on November 29, 2014, 19:09:30
I can't re-produce this problem, for me it works fine. Maybe you can post the error message you get, a screenshot or give some more information. For me there is no problem.
Title: Re: problem with a publication date
Post by: wbread on November 30, 2014, 09:26:51
I have only one theory. :-\
in our region was changing time by -1 hour ago, but I was not able to automatically change the time on the server.
Title: Re: problem with a publication date
Post by: datahell on November 30, 2014, 13:31:02
No, this is not the problem. Elxis stores all dates in UTC/GMT (Greenwich) time. Only on display it formats the datetime to your local time zone*.

This specific feature (publish date) uses a date converter (elxisDate::convertFormat) only for the date format without affecting the actual date. Meaning without applying changes due to different time zone. So the date you insert it is already GMT/UTC. The conversion it does is because the date is written differently in each language. For instance in Greece we write Day/Month/Year while in USA Month/Day/Year. Internally in database all dates are saved in this format: YYYY-mm-dd HH:ii:ss (GMT)

* Example
Iceland has the time difference you mention (-1). We consider you have set time zone in Elxis configuration to Iceland (-1 hour from GMT).
When you see this date: 2014-11-30 18:30:00 then the actual date stored in database is 2014-11-30 19:30:00. So, any date you see is -1 hour from the stored value in database.

The oposite
A date stored in database as 2014-12-01 00:30:00 will be displayed to you as 2014-11-30 23:30:00