Title: Format date within loop
Last modified: August 30, 2016

---

# Format date within loop

 *  Resolved [dawnrae](https://wordpress.org/support/users/dawnrae/)
 * (@dawnrae)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/format-date-within-loop/)
 * How do you format the date within a loop?
 * [https://wordpress.org/plugins/custom-field-suite/](https://wordpress.org/plugins/custom-field-suite/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * (@mgibbs189)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/format-date-within-loop/#post-6564661)
 * It’s the same way you format a non-loop date field. You run the value through
   the date() / strtotime() functions.
 *     ```
       $loop_field = CFS()->get( 'my_loop' );
       foreach ( $loop_field as $row ) {
           $formatted_date = date( 'Y', strtotime( $row['the_date_field'] ) );
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Format date within loop’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Matt Gibbs](https://wordpress.org/support/users/mgibbs189/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/format-date-within-loop/#post-6564661)
 * Status: resolved