summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-04-07 22:02:44 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-04-07 22:02:44 (GMT)
commitbdf0b26e197fcdb7d33ee5ca5bb6920ce04ce5ea (patch)
treef159f1550c877129abd687789e1c12bb9075d7fb
parent98ceb8faf3d8308688bbb52c268753b35ed96887 (diff)
functions: fix date calculations
In case date(1) does not support nanosecond resolution, it does not interpret '%N', and leave it as-is. So we have to remove it. Note that some versions replaces '%N' with 'N', so we have to take this into account as well. Reported-by: Kyle Grieb <grieb.kyle@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rw-r--r--scripts/functions2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions
index c504684..3261a80 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -250,7 +250,7 @@ CT_Which() {
# to the highest entire second
# Usage: CT_DoDate <fmt>
CT_DoDate() {
- date "$1" |sed -r -e 's/N$/000000000/;'
+ date "$1" |sed -r -e 's/%?N$/000000000/;'
}
CT_STEP_COUNT=1