aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-05-26 21:06:02 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-05-26 21:06:02 +0200
commit08520fec143abd63000885f9d8fadb66ef203435 (patch)
tree292f1def3e5ec73af73c75038e19849f292ef624
parente66e302cea1e562ac5030c3855d6e14fb0b64243 (diff)
Make datetime pass on -u in all cases
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/util.bash5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cbe97d4..523c4c0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `pkg_*()` functions no longer _require_ a `pkg.*` value to be defined. If one
is not set explicitly, a warning will be generated, but the original name
passed to the `pkg_*()` function will be used by the host's package manager.
+- `datetime()` now always passes `-u` on to `date`.
## [1.0.0] - 2022-05-06
diff --git a/lib/util.bash b/lib/util.bash
index da491bb..6ad69e1 100644
--- a/lib/util.bash
+++ b/lib/util.bash
@@ -24,14 +24,15 @@ chgdir() {
datetime() {
local date_opts
+ date_opts+=("-u")
+
# Apply SOURCE_DATE_EPOCH as the date to base off of.
if [[ $SOURCE_DATE_EPOCH ]]
then
date_opts+=("-d@$SOURCE_DATE_EPOCH")
- date_opts+=("-u")
fi
- date "${date_opts[@]}" +"${1:-%FT%T}"
+ date "${date_opts[@]}" +"${1:-%FT%TZ}"
}
# Log a message as error, and exit the program. This is intended for serious