date field is not saved
-
I have an issue where date fields are not saved and existing datefields change each save to a day earlier, so 5 october 1990 becomes 4 october 1990.
-
I don’t know what the not saving issue is about, can you be more specific about how you have the date field set up and what you’re seeing?
As to the shifting date, this can happen if the server timezone is different from your site timezone. Make sure the site timezone is correct (should be your local timezone). If you can set the server “php” timezone, you should try that too.
There is a setting “Sync php Timezone” that attempts to synchronize php with WordPress timezones, this is in the settings under the advanced tab.
Hi Xnau,
I have the same shifting date issue. WP 5.3.1, Participants Database 1.9.4.4.
My blog timezone is “Berlin” and “Sync PHP Timezone” is on. However, I’m currently in North America (EST). When using the backend record edit, for example, the “Birthday” field (type Datefield), shows “21. November 2019”. When clicking “Save” – no data changes at all – the “Birthday” changes to “20. November 2019”.
If I see it right, the issue happens when storing the date (i.e. the db record timestamp does not match the entered date).
Since I have admins in multiple timezones, could you please check again?
Thanks!
MarcI discovered that switching from ‘berlin’ to gmt+1 solves the issue.
It looks like the plugin/setup can’t handle a city as timezone anymore. It used to work fine recently.
Thanks for pointing this out, I’ll check check on that. For city timezones, it needs to include the continent, so “Europe/Berlin” may work.
The plugin stores dates as unix timestamps, which are UTC. The time is stored as 0:00.
When the date is displayed, the timezone defined for the site is used, so that can result in the date shifting. The actual stored date value is not changed. Also, there isn’t any way to adjust for users in multiple timezones.
- This reply was modified 4 years, 11 months ago by xnau webdesign.
in wordpress settings gui it says ‘Berlin’ don’t know if in the background it is used as Europe/Berlin.
I wonder about your remark that the actual stored date is not changed. Because if i save a date like 5 december it shows 4 december, saving it again makes it 3 december, saving it another time makes it 2 december! So you never know anymore what the original date was.
I have used Participants Database in the UK for years without any problems. However, very recently it has exhibited a lot of date related problems – dates out by one day, dates not saving, etc. I tried suggested solutions which have not worked, but have now found a fix after much trial and error with various settings.
Here are Original Settings:
WordPress Timezone: London
WordPress Date Format: d/m/Y
PD Strict Date Format: Checked
PD Input Date Format: dd/mm/yyyy
Sync php Timezone: CheckedHere Are the New Settings Which Fixed the Problems:
WordPress Timezone: UTC+0
WordPress Date Format: d/m/Y
PD Strict Date Format: Checked
PD Input Date Format: d/m/Y
Sync php Timezone: CheckedI am posting this in the event that this information may be of use to other PD users.
It looks like I’m going to have to revisit this. The stored date value should not be changed, that is clearly not right.
@knireis, are you using the “strict date format” setting?
yes i do
I can confirm that changing from “Berlin” to “UTC+1” is a temporary workaround.
If I understand it right, “Berlin” would take Daylight Saving Time into consideration (Germany is UTC+2 in summer). So the workaround can’t be permanent.
Thanks,
MarcIt’s true that if you select something like “Berlin” as your timezone setting in WP, it is saved as “Europe/Berlin” in the database.
Why this would change how Participants Database works I don’t know, the code checks out, but I’m still investigating.
The reason why the date is changing is very simple: there is a difference between the timezone setting for your WP and the timezone setting for php on your hosting server.
If you have these two set to the same timezone and it does continue to shift, it is most likely because your php configuration is not inherited. This means that even if you have your php configured to your timezone, the code is actually running on the default php timezone. This can happen if php is not configured to propagate the local settings into all subdirectories.
The plugin provides a way to keep the two settings in sync if you don’t want to change the php timezone setting on the server, or if changing the server configuration doesn’t help.
It’s in the plugin settings under the advanced tab, called “Sync php Timezone” and when that is checked, the plugin uses the WP setting to set the php timezone. As long as those two are the same, the date will not shift.
If the “Sync php Timezone” setting does not fix this issue, you should ask your web host about the correct way to set the php timezone.
I have the sync php timezone set to on. It used to work fine with timezone ‘Berlin’. As of a few weeks it does not anymore. Like with @lund and others.
So either our webhost has changed php settings at the same time, which would be quite a coincidence (maybe they all use cpanel and cpanel changed something in their setup).
Or something has changed in WordPress, Participantsdatabase or how they work together.
- The topic ‘date field is not saved’ is closed to new replies.