Posted: November 25, 2021 at 4:41 pm
in the API we have noticed that the REG_date_gmt is showing as local time for the site and the Reg_date is +11 hours out so the latest registrations in the WP-ADMIN are all showing with future dates.
We have the timezone city set to Sydney, the servers timezone is UTC
this is urgent as things are not reconciling correctly
Event Espresso stores all datetimes as UTC+0 and then applies the offset based on the site settings from there.
I went through and set up a site using Sydney for the timezone, then added multiple frontend and admin registrations onto an event, all of those show the correct values in the database and on the REST API.
Usually when something like this happens its because another plugin is changing the servers timezone, how did you check the above?
If you use the WP Health Check & Troubleshooting plugin:
Then go to Tools -> Site Health -> Troubleshooting and enable Trobuelshooting mode.
What that does is disable all plugins and switches the site to a default theme, but only for you (the logged-in admin), so with that enabled go to Troubleshooting mode in the admin bar and manage active plugins.
Enable Event Espresso in troubleshooting mode, do the dates show correctly then?
(Once finished with Troubleshooting mode, go to the admin bar again and deactivate it to switch back to normal. You’ll also find a button to do so on the Dashboard under /wp-admin/)
You mentioned this is ‘recent’ registrations so may I ask what has changed on the site between when this was working and now?
Things are still not looking correct on the REG_date and still saying I booked in the future more detailed notes of what I am seeing below.
I did what you said and did a health check all was good.
As you will see from the data below the GMT is not calculating correctly.
What I am seeing from the API call, is that the GMT time is loading local time in my case Australia/Sydney then Reg_date goes forward the number of hours between UTC and Australia/Sydney as you see below.
This looks to be the AU/Sydney time of when the registration was created.
And the Reg_date has added time into the future
The attendee first the last name is timestamped with my timezone Pacific/Auckland time 2 hours ahead of Sydney as yo can see on the first and last name fields
The API URL i ran up in POSTMAN, added a where on REG_ID to get the test record.
Full JSON output from above a GET request
I also have a set of bad dates where it appears to be making the REG_date in the API be in the future and the REG_date_gmt to be the local Sydney time when the ticket was created.
Can you explain why this is happening as it is not just a one-off occurrence?
This is messing with our API imported as we are using the reg date as the reference to obtain the newest records each time we fetch a new set of registrations. Hence sometimes the GMT is correct so the ticket is missed as it goes back to the correct time. eg Australia/Sydney -11 hours to get GMT. While other times EE is storing the Australia/Sydney time, not the GMT date.
AS you can see from my laptop Pacific/Auckland time in the attached link
is someone going to help with this issue?
Has anyone looked into this ticket for me as the REG_date and REG_date_gmt are giving me dates/times into the future sometimes and the past other times?
This is messing up our import of data into a SUGARCRM as we are missing some records as we go from the last modified date of the last record fetched.
These records in turn then generate tickets and guestlists for the end-user. It does not happen all the time which is why I’m baffled need help, I did what Tony had said above and all was fine, the timezones on the site(s) are correct.
I also know that it is a future date as we are in NZ +13, AUS +11 I have also replicated this several times when creating a ticket and normally it is when you put more than one type of ticket on an order. Not the same ticket types either.
I’ve spent some time digging into this but so far I’ve not been able to reproduce and I’ve tried various set-ups.
Are these registrations being added as normal through the checkout process or something else?
Did this start happening at a specific point? For example, did it start happening after an update?
Yes, these registrations are being added as normal via the checkout. Also, EE is 95% out of the box, what we do is run multi-ticket types on events. IT is a multi-site environment and is only like this for the currency on Stripe payments.
The point in time is a few months back to around July or even a bit further than that where the dates are out of sync.
I have also given you a link to a small sample from the wp_esp_registration table and highlighted in blue where you can see the date change
Also, can you give me some good places in EE you would suggest to add in some logging so that I can trace this further from my end?
I am open to a team, zoom or another video conference if that helps where I can share my screen, just let me know and ill drop anything else I’m doing to jump on a call with you