I've got an events listings which works pretty well and there is a:

  • Custom Date field, eventEnd (just date)
  • Custom Start Time, eventStart (just time)
  • Custom End Time, eventEnd (just time)

I can list these entries so we list by date then time by using:

{% for entry in craft.entries.section('events').order('eventDate', 'eventStart').find() %}

but eventStart is ignored altogether, even when I would use:

{% for entry in craft.entries.section('events').order('eventStart').find() %}

I would expect:

Event 1: 14:00 Event 2: 15:00 Event 3: 16:00

but instead get something more random based I think on post date.

Suggestions welcome thank you!


my biggest issue is actually being able to list by eventStart at all. Just using {{ eventStart }} reveals the current date. But if I try to boil down to just the hour, it's not a recognised way of ordering (even though it's just a set of numbers?)

So, I'm not sure where to head with this. I'm sure that if my start time was bundled in with the main date, all would be fine, but it makes the system a bit less obvious and flexible.

Here's what I've tried:

{% set completeeventlist = craft.entries.section('events') %}
{% for x in craft.entries(completeeventlist).order('eventDate') %}
    {% set es = x.eventStart|date('H') %}
        {% for entry in craft.entries(x).order(es) %}
        <li>{{ entry.id }}{{ es }}</li>
    {% endfor %}
{% endfor %}
  • Have you tried: {% for entry in craft.entries.section('events').order('eventDate, eventStart').find() %} Commented Jan 15, 2015 at 11:45
  • Tried that - throws an error CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'eventStart' in 'order clause' Commented Jan 15, 2015 at 13:58
  • eventStart is defiantly there, just ignored though as something to order from. Commented Jan 15, 2015 at 14:00
  • is it a custom fieldType from a plugin? Commented Jan 15, 2015 at 14:50
  • No, just a normal datetime field. It's a custom field, but it's just the time. Commented Jan 15, 2015 at 19:09

1 Answer 1


Craft always saves a complete DateTime value to the database, even if you only make it set / show the time part of it in the Control Panel.

To ignore the date part (which in this case is set to the day you saved your entry) within the order parameter, you can make use of the time() MySQL function:

{% set entries = craft.entries.section('events').order('eventDate', 'time(eventStart)') %}
  • That "time()" function inside the order did the trick for me. Couldn't figure out why it couldn't order correctly from a time field.
    – Ole
    Commented Jan 21, 2016 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.