Title: Date field look
Last modified: October 6, 2016

---

# Date field look

 *  [marcie73](https://wordpress.org/support/users/marcie73/)
 * (@marcie73)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/date-field-look/)
 * Hello, you made a very useful and powerful plugin!
    I have a question: I have
   a date field and I would like the value to be saved in the database like dd/mm/
   yyyy, but now is displayed the other way around yyyy/mm/dd. Where Can I change
   it? Thank you so much.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/date-field-look/#post-8261256)
 * The plugin is storing the date string in the format that the browser sends (which
   could be different than it displays it). The plugin just displays what it has
   verbatim.
 * You can try to (1) convert it when it goes into the DB or (2) try to convert 
   it when you display it in a shortcode or export.
 * (1) You will need to hook in the following PHP code to do the conversion. See:
   [http://cfdbplugin.com/?page_id=747](http://cfdbplugin.com/?page_id=747)
 *     ```
       function convert_date_filter($formData) {
           $formName = 'dateform'; // change this to your form's name
           if ($formData && $formName == $formData->title) {
               // change 'field' to the name of the field holding your date
               $formData->posted_data['field'] =
                       date('d/m/y',
                               strtotime($formData->posted_data['field']));
           }
           return $formData;
       }
       add_filter('cfdb_form_data', 'convert_date_filter');
       ```
   
 * (2) In a shortcode or export, assuming your date field was called “field”, you
   can use a transform like this:
    `trans="field=strtotime(field)&&field=date(d/
   m/y,field)"`
    -  This reply was modified 9 years, 7 months ago by [Michael Simpson](https://wordpress.org/support/users/msimpson/).
 *  Thread Starter [marcie73](https://wordpress.org/support/users/marcie73/)
 * (@marcie73)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/date-field-look/#post-8271759)
 * It works! Thank you very much! But only for new submissions. Is there a way to
   change manually old records or I need to operate directly in phpmyadmin? I also
   need to merge two field columns because I changed the name of a field in the 
   form but it created a new column. I don’t know how to do it. Thank you for any
   help!
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/date-field-look/#post-8272149)
 * You can change data by purchasing the [CFDB Editor](http://cfdbplugin.com/?page_id=459)
   or directly in PHPMyAdmin

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Date field look’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/date-field-look/#post-8272149)
 * Status: not resolved