Custom Fields
Re-Envisioned
Support MB Custom Table Date format between custom field and database field Reply To: Date format between custom field and database field

#13866

Anh Tran
Keymaster

Hi Sergio,

This is a great question! While saving the date with varchar is not a problem, I think saving in date format of MySQL might be a better idea. However, as you see, MySQL forces data saved in the DB in its format, not what you enter. So, I think there are 2 solutions for this:

  1. Just use varchar, so you save what you enter
  2. Use the save_format attribute for the field, set it to the format of MySQL and you’re free to go. It tells Meta Box to store value in one format and display in another format.