diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-04-07 22:02:44 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-04-07 22:02:44 (GMT) |
commit | 6e760223a4b413b23afaf03eeae78b0a1f021b93 (patch) | |
tree | 9f7baa74a026012a1d1d42cd7e9759edb92c7bcf /scripts/functions | |
parent | 0dccde0190ec691e9ee5f549fae3b75a4ede3fb8 (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>
(transplanted from bb6e2df2427f3db871721c96ca3226cfa24204bc)
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions index 321ad12..2764b7c 100644 --- a/scripts/functions +++ b/scripts/functions @@ -235,7 +235,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 |