So I am currently using the 3rd party Date and Time Picker Field addon. With the new 5.3.9 including it into core I would like to switch over to it. I have a bunch of time fields. Looks like with a little revisions to my theme and custom fields I can get it working in the same time format however I haven’t figured out a good solution to handle my old data as the database format appears to be different.
Old 3rd party addon db format: https://cloudup.com/c6N-zYggFKk
New ACF 5.3.9 db format: https://cloudup.com/coB_hqi9UrP
Any suggestions? I assume the cleanest way to handle would be to do a one time batch updates to all of my old fields. I have over 5000 custom post entries each with potential of 8 custom time fields. For now I’m just going to continue using ACF Pro 5.3.8.1 while I work out this database conversion issue on my staging site.
Hi @anchordev
Thanks for the quesiton.
Looks like the 3rd part field is saving the value as a time stamp, whereas ACF saves the value in a human friendly format hh:ii:Ss.
The 2 should be compatible, have you tried loading the old and new values via get_field()? What is the result of each?
I haven’t begun working on the frontend as the backend displays are wrong. Here is what I’m seeing.
Old site running with these settings: https://cloudup.com/cojHB_KpIIk are displaying a 10:00 start time as shown here: https://cloudup.com/c6vO0wJ3GSu
New site running with these settings: https://cloudup.com/cKh3nZzN7U1 are displaying a 21:05 start time as shown here: https://cloudup.com/cJuQ9A2AG9P on the same entry.
In the database the start time field is set to 1465898400.
Hi Austin
Thanks for the email.
I’ll do some testing with these setting / values, and get back to you with my findings.
In the meantime, can you please download the latest plugin files from your account online to make sure you have the most up to date timepicker code?
* I made some quick updates to this field post launch
I updated to the latest version and it appears to have fixed the old entries on all of my edit screens! They are now showing the correct time. With this I believe I’m good. Thanks so much.
Hi @anchordev
I’ve just made some more improvements with compatibility.
Please read my final reply to this topic:
https://support.advancedcustomfields.com/forums/topic/datetime-picker-in-5-3-9-causes-trouble/
Thanks
E
The topic ‘Database convert from old time format’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.