# sortBy 'date' but specify which part of 'date'

**URL:** <https://forum.getkirby.com/t/sortby-date-but-specify-which-part-of-date/22859>\
**Category:** Questions\
**Created:** [July 13, 2021, 10:41am UTC](https://forum.getkirby.com/t/sortby-date-but-specify-which-part-of-date/22859 "2021-07-13T10:41:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jannis](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@Jannis](https://forum.getkirby.com/u/Jannis)\
**Post date:** [July 13, 2021, 10:41am UTC](https://forum.getkirby.com/t/sortby-date-but-specify-which-part-of-date/22859/1 "2021-07-13T10:41:07Z")

</div>

Hey there,

I want to output a list and sort it by date. The date format of my articles is _d-m-Y_.

When using `page('articles')->children()->sortBy('date', 'desc')` the articles get ordered by _day_. What I want though is to have them sort by _year_.

Is there an easy way to do this in kirby?

Thanks  
Jannis

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [July 13, 2021, 11:03am UTC](https://forum.getkirby.com/t/sortby-date-but-specify-which-part-of-date/22859/2 "2021-07-13T11:03:18Z")

</div>

See example here: [Sorting | Kirby CMS](https://getkirby.com/docs/cookbook/content/sorting#sorting-by-a-single-field)
