buildbot-setup-device.sh: minor fix getting date from older devices

The output of the date command on older devices can include CRLF and
this otherwise breaks the time comparisons in this script.

Bug: 224733324
Test: manual
Change-Id: I2e0bccceef95abbb8304184c404fedb05052a5cc
diff --git a/tools/buildbot-setup-device.sh b/tools/buildbot-setup-device.sh
index 1cad3e3..decb247 100755
--- a/tools/buildbot-setup-device.sh
+++ b/tools/buildbot-setup-device.sh
@@ -36,7 +36,11 @@
 adb shell date
 
 host_seconds_since_epoch=$(date -u +%s)
-device_seconds_since_epoch=$(adb shell date -u +%s)
+
+# Get the device time in seconds, but filter the output as some
+# devices emit CRLF at the end of the command which then breaks the
+# time comparisons in this script (Hammerhead, MRA59G 2457013).
+device_seconds_since_epoch=$(adb shell date -u +%s | tr -c -d '[:digit:]')
 
 abs_time_difference_in_seconds=$(expr $host_seconds_since_epoch - $device_seconds_since_epoch)
 if [ $abs_time_difference_in_seconds -lt 0 ]; then