Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Moises

Custom Field DATE problem with unix time stamp

Hello, my theme has a date field with selector that enters the format: m / d / Y. But this date is converted and written to the database in unix time stamp format.

I’m trying to create an inline edit with Field Type DATE, but when I edit the date it goes wrong in unixtimestamp format.

7 years, 1 month ago
Stefan van den Dungen Gronovius
Developer

Hi Moises,

The problem with Custom Fields and our date type is that we don’t know the date format for the current date format. For reading out the value for in the column, we can use some functions to make it work automatically, but for editing and writing it back to the database, we cannot do this. We have to choose a specific format and therefore we chose the same format that ACF uses ‘Ymd’.

When you made the custom field with ACF, Pods or Types, you should be able to tackle this problem by installing the integration add-on for that plugin. But since your custom field is shipped with your theme, I expect that it is not shipped with one of these plugins. In that case, you can fix your problem by setting the date format for your column with one of our filters. You can have a look at the example on this page:
https://www.admincolumns.com/documentation/filter-reference/acp-editing-save_value/

Of course, you’ll have to change the custom field key to the themes date key.

7 years, 1 month ago

You must be logged in to reply to this topic.