Elxis CMS Forum
Support => General => Topic started 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?
-
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
-
The problem is - when I try to save an article gives me an error that the date is not correct
-
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.
-
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.
-
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