# Sorting date/time with hours in AM/PM

**URL:** https://forums.knack.com/t/sorting-date-time-with-hours-in-am-pm/20572
**Category:** Get Answers
**Created:** [September 22, 2026, 2:35am UTC](https://forums.knack.com/t/sorting-date-time-with-hours-in-am-pm/20572 "2026-09-22T02:35:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Remote](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@Remote](https://forums.knack.com/u/Remote)
#### Post date: [September 22, 2026, 2:35am UTC](https://forums.knack.com/t/sorting-date-time-with-hours-in-am-pm/20572/1 "2026-09-22T02:35:35Z")

</div>

I have a Date/Time field with a FROM and TO date/time, Time Format set to HH:MM am. I might have 9/21/2026 11:00am to 9/2 **2** /2026 8:00am OR 9/19/2026 9:00am to 1:00pm. I want the user interface to be AM/PM, not 24 hour format.

Sorting by the Date/Time presents 11:00 AM before 9:00 AM because the “1” comes before the “9”. How do I get the sort to work properly without changing to 24 hours? What am I missing? I’ve done a bit of coding for this but I figure there has got to be a better way.

ONE Alternative : I used a formula field to extract the first 18 characters of the Date/Time to get the Start Date/Time, created a second date time field to the extract (condition) and set THAT field to 24 hours, and sorted by that field. It seems a lot of work to do something simple.

Thank you for your consideration.

Karen

---

<div class="post-metadata">

### Author: ![StephenChapman](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/stephenchapman/32/1759_2.png) [@StephenChapman](https://forums.knack.com/u/StephenChapman)
#### Post date: [September 22, 2026, 9:26pm UTC](https://forums.knack.com/t/sorting-date-time-with-hours-in-am-pm/20572/2 "2026-09-22T21:26:34Z")

</div>

Hi Karen (@Remote), can you share a screenshot of your date from/to field not sorting properly?

Below is an example of the date/time field sorting chronologically from earliest to latest on my side, in 12 hour time:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/d/d93f4bf0eb079952b35c1cb33c2b493d98d603f9.png)
