# How to sort a random DateTime array from oldest to newest?

**URL:** <https://forums.unrealengine.com/t/how-to-sort-a-random-datetime-array-from-oldest-to-newest/274128>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4-27, question\
**Created:** [January 22, 2022, 7:21am UTC](https://forums.unrealengine.com/t/how-to-sort-a-random-datetime-array-from-oldest-to-newest/274128 "2022-01-22T07:21:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 22, 2022, 10:37am UTC](https://forums.unrealengine.com/t/how-to-sort-a-random-datetime-array-from-oldest-to-newest/274128/3 "2022-01-22T10:37:44Z")

</div>

There’s a DateTime comparision node

![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/b/ab40290bff36635bf8e68688c99c8bb05ec3a14a.png)

You basically have to run through the array and find the lowest one and put that in a new array. Then repeat.

That’s a bubble sort.

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-sort-a-random-datetime-array-from-oldest-to-newest/274128)._
