[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9e730a4 3/4: Specify UTC in case TZ is otherw
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9e730a4 3/4: Specify UTC in case TZ is otherwise |
Date: |
Thu, 27 Feb 2020 16:09:38 -0500 (EST) |
branch: master
commit 9e730a471a34d56c1b72e2fc5ebb67adbdae975d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Specify UTC in case TZ is otherwise
A corporate redhat server seems to use a local timezone. It seems
sufficient to change only this redhat-specific script, because all
other work is done in a debian chroot. Probably this change does
nothing in practice, unless the script is run almost at the moment
of a daylight-saving change, but it's simplest to make that problem
impossible by specifying '-u' consistently.
---
install_redhat.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install_redhat.sh b/install_redhat.sh
index 83441df..e0957ce 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -168,7 +168,7 @@ cp -a /srv/chroot/${CHRTNAME}/tmp/${CHRTNAME}-apt-get-log
/home/"${NORMAL_USER}"
stamp1=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo "Finished: $stamp1"
-seconds=$(($(date '+%s' -d "$stamp1") - $(date '+%s' -d "$stamp0")))
+seconds=$(($(date -u '+%s' -d "$stamp1") - $(date -u '+%s' -d "$stamp0")))
elapsed=$(date -u -d @"$seconds" +'%H:%M:%S')
echo "Elapsed: $elapsed"