Title: Sorting Events
Last modified: March 10, 2021

---

# Sorting Events

 *  [pacdev1](https://wordpress.org/support/users/pacdev1/)
 * (@pacdev1)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/sorting-events-5/)
 * I am trying to get events to sort. I want them sorted by date. Nearest date first,
   then other dates after that (Mar, Apr, May, etc).
 * $eventsdata = $search->get_events_between($start_time, $end_time, array(), true);
 * Obviously, I am trying to sort the array returned to $eventsdata.
 * I have tried asort, ksort, etc. I can’t get it to sort how I need it to.
 * Does anyone have a way to sort this?
    -  This topic was modified 5 years, 3 months ago by [pacdev1](https://wordpress.org/support/users/pacdev1/).

The topic ‘Sorting Events’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/all-in-one-event-calendar.svg)
 * [Timely All-in-One Events Calendar](https://wordpress.org/plugins/all-in-one-event-calendar/)
 * [Support Threads](https://wordpress.org/support/plugin/all-in-one-event-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/all-in-one-event-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/all-in-one-event-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/all-in-one-event-calendar/reviews/)

## Tags

 * [ai1ec](https://wordpress.org/support/topic-tag/ai1ec/)

 * 0 replies
 * 1 participant
 * Last reply from: [pacdev1](https://wordpress.org/support/users/pacdev1/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/sorting-events-5/)
 * Status: not resolved