---
updatedAt: 2026-01-24T01:58:10.000Z
agentTools:
  projectIndex: https://docs.observeinc.com/llms.txt
---

# How do I sort dates by time when they are sorted alphabetically?

A column of dates may sort in the wrong order because it is improperly typed. Convert the column to `timestamp` to make it sort properly.

Use [`parse_timestamp`](https://docs.observeinc.com/docs/function-parse_timestamp#/) to convert the string column to `datetime` and [`sort`](https://docs.observeinc.com/docs/verb-sort#/) to order from maximum to minimum:

<OpalCodeBlock
  code={
`// time arrives in a string column formatted as "03/14/24 20:50:28.057"
make_col time:parse_timestamp(time, "DD/MM/YY HH24:MI:SS.FF3")
sort desc(time)
`}
/>