Sort entries by time part only of DateTime object I am trying to 


filter and sort show entries by what time they begin
display the current show


I have two fields, startTimeand endTime, and while Craft lets me display only the time part in the Control Panel, I can't filter entries in my template by the time part only.

Listing out entries:

{% set shows = craft.entries({
    section: 'shows',
    order: 'startTime asc',
    day: 'sunday',
}) %}


Displaying the current show:

{% set nowPlaying = craft.entries({
    section: 'shows',
    startTime: '&lt;= ' ~ rightNow | date('c'),
    endTime: '&gt;' ~ rightNow | date('c'),
    day: rightNow | date('l'),
}) %}


If I create all my show entries on the same day, filtering by the whole date is fine, but that's assuming


the times are never changed (thus updating the date)
I don't care to know what show is currently playing (because a show will only show up if I created it today).


I prefer not to reinvent the wheel by making a template-side sorting algorithm. Is there not a more elegant way to query just the time part in Craft filtering?
For those interested, I found out you can tell Craft to search the database for the time part only with the mySQL command time() (Order entries by custom time field). For example:

{% set shows = craft.entries({
  section: 'shows',
  relatedTo: day.id,
  order: "time(startTime)",
}) %}


However, this sorts based on the absolute DB time (GMT time), so I substituted a conversion command for startTime:

{% set convertedStartTime = 'convert_tz(startTime,"+00:00","-06:00")' %}

{% set shows = craft.entries({
  section: 'shows',
  relatedTo: day.id,
  order: "time(#{convertedStartTime})",
}) %}


To my complete shock, this actually works. I could not find a similar way to search for the current show, so I first filtered entries by day, then ran a for-loop to find the current show (there's only ten shows or so per day):

{% set todaysShows = craft.entries({
  section: 'shows',
  relatedTo: today,
}) %}

{% for show in todaysShows if not done %}
    {% set start = show.startTime | date_modify('now') %}
    {% set end = show.endTime | date_modify('now') %}

    {% if now &gt;= start and now &lt; end %}
        {% set nowPlaying = show %}
        {% set done = true %}
    {% endif %}

  {% endfor %}`