Skip Navigation

[Resolved] Dates appear incorrectly when displayed; are correct in database

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 6 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1124525

Seems like the display of renewal dates is messed up. I have dates stored as unix timestamps in the database and when presented in views I now see they are incorrect. They are pretty close to what you'd expect though, so I haven't noticed this for a while.

For example, in a view displaying the data stored in a custom field for a custom post type, We see "April 14, 2018". However, the database says 1564718400. Punching that into epochconverter.com, I get "Friday, August 2, 2019", which also matches our source of data outside of the system.

So it seems things are correct data-wise but WordPress is translating the seconds since epoch value of "1564718400" to "April 14, 2018" for some reason.

Please advise on how we can investigate this issue.

This is on a live, business site with users already, so if there's anyway to expedite this that would be great. I can setup access to the site for your investigation, etc.

#1124688

Hi, sounds like either a caching issue or a targeting issue. Can you try these troubleshooting steps first?
- Temporarily disable any site caching systems or caching plugins
- Turn caching off for the View in question. You can do this by adding a parameter to the View's shortcode:

[wpv-view name="Your View Name" cached="off"]

- Verify that the custom field is targeted correctly. Just before your custom field shortcode, insert the post title shortcode. If you do not want it to be visible on the live site, use a hidden span like this:

<span style="display:none;">[wpv-post-title]</span>[types field="your-date-field-slug"][/types]

Then you can inspect the source of the page to see if the custom field value is targeting the correct post (you should see the name of the post that includes the date custom field). If not, then it's probably just a matter of adding the correct post information in the Types field shortcode.

Please let me know the results of these tests and we can go from there.

#1124689

Hello Christian,

We do not use caching and I know the correct data is being targeted, as changes in the date in the wordpress front end is reflected in the view properly.

#1124718

I apologize, I was submitting this on behalf of another tech person here, and they totally we're looking at the wrong posts when they were comparing the backend to frontend.

You can close this ticket, I apologize for wasting your time!

#1124788

Sure, I will mark this one resolved. Thanks!