Title: john2016's Replies | WordPress.org

---

# john2016

  [  ](https://wordpress.org/support/users/john2016/)

 *   [Profile](https://wordpress.org/support/users/john2016/)
 *   [Topics Started](https://wordpress.org/support/users/john2016/topics/)
 *   [Replies Created](https://wordpress.org/support/users/john2016/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/john2016/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/john2016/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/john2016/engagements/)
 *   [Favorites](https://wordpress.org/support/users/john2016/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [order by meta_value where value contains array with date](https://wordpress.org/support/topic/order-by-meta_value-where-value-contains-array-with-date/)
 *  Thread Starter [john2016](https://wordpress.org/support/users/john2016/)
 * (@john2016)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/order-by-meta_value-where-value-contains-array-with-date/#post-7382663)
 * TrishaM, thank you for your answer.
 * The dates are stored in this format: m.d.Y
 * But they are stored in the custom field **movie_time_values** together with some
   other values. Example value:
    `',{"theatre":"","date":"05.28.2016","time":"20:
   00","place":"","ticket":"","button_text":"","button_link":""}'`
 * So I need to sort the value of “date” ascending, in above example with value:
   05.28.2016.
 * I am also struggling with some values in this code:
 *     ```
       'meta_key' => 'movie_time_values',
       'orderby' => 'meta_value_num',
       'order' => 'ASC',
       'meta_query'	=> array(
       'relation'		=> 'AND',
       	array(
       	'key'		=> 'movie_time_values',
       	'value'		=> $today,
       	'compare'	=> '>='
       ))
       ```
   
 * I don’t know if **relation** is needed.
    And i think **value** needs to be an
   array, because i need to point to the value of the date portion..
 * Last night i was trying to get the post_id and date (strtotime) together in one
   array. Then reorder the array using ksort.
 * I was able to create the following array, but i wans’t able to sort on date. 
   And after that i don’t know how to loop through the posts with the new ordered
   post_id list:
 *     ```
       Array
       (
           [0] => Array
               (
                   [1475193600] => 2067
               )
   
           [1] => Array
               (
                   [1475280000] => 2070
               )
   
           [2] => Array
               (
                   [1475280000] => 2078
               )
       ```
   

Viewing 1 replies (of 1 total)