graphite: Factor time_utils out of the es_utils module.

We're planning to move the graphite support code into chromite so it can be
used by autotest and by other infrastructure bits. To do that, we have to
remove dependencies on other bits of autotest, specifically time_utils and the
global configuration.

The time_utils module is used in essentially one spot where it converts a
function parameter into a particular format. To remove that use, the conversion
is pushed out to the callers. That's a bit clunky and cumbersome, but once the
code has been moved we can add a little wrapper function which will centralize
that again. I don't want to add the wrapper now because I'd want to put it
where the other code is currently.

BUG=chromium:446291
TEST=Ran a trybot for butterfly-paladin with --hwtest.

Change-Id: Iaf2ee2e664ff8040f4e143dfd32119c471d0bc43
Reviewed-on: https://chromium-review.googlesource.com/238526
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Trybot-Ready: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
diff --git a/site_utils/devserver_history.py b/site_utils/devserver_history.py
index 4cd94ba..492a000 100755
--- a/site_utils/devserver_history.py
+++ b/site_utils/devserver_history.py
@@ -98,10 +98,13 @@
     if artifact_filters:
         for artifact in artifact_filters:
             eqs.append(('artifacts', artifact))
+    time_start_epoch = time_utils.to_epoch_time(time_start)
+    time_end_epoch = time_utils.to_epoch_time(time_end)
     query = es_utils.create_range_eq_query_multiple(
             fields_returned=None,
             equality_constraints=eqs,
-            range_constraints=[('time_recorded', time_start, time_end)],
+            range_constraints=[('time_recorded', time_start_epoch,
+                                time_end_epoch)],
             size=size,
             sort_specs=[{'time_recorded': 'desc'}],
             regex_constraints=regex_constraints)