summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/libs/lib-misc.sh9
-rw-r--r--src/core/libs/lib-ui-interactive.sh4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index 1e8df8e..aa00dc6 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -104,6 +104,7 @@ cleanup_runtime ()
# $1 UTC or localtime (hardwareclock)
# $2 direction (systohc or hctosys)
+# $3 selected TIMEZONE (optional)
dohwclock() {
# TODO: we probably only need to do this once and then actually use adjtime on next invocations
infofy "Resetting hardware clock adjustment file"
@@ -116,7 +117,11 @@ dohwclock() {
if [ "$1" = "UTC" ]; then
hwclock --$2 --utc
else
- hwclock --$2 --localtime
+ if [ ! "$3"x == "x" ]; then
+ local ret=$(TZ=$3 hwclock --$2 --localtime) # we need the subshell so that TZ does not set in this shell
+ else
+ hwclock --$2 --localtime
+ fi
fi
}
@@ -124,4 +129,4 @@ target_configure_initial_keymap_font ()
{
[ -n "$var_KEYMAP" ] && sed -i "s/^KEYMAP=.*/KEYMAP=\"$var_KEYMAP\"/" ${var_TARGET_DIR}/etc/rc.conf
[ -n "$var_CONSOLEFONT" ] && sed -i "s/^CONSOLEFONT=.*/CONSOLEFONT=\"$var_CONSOLEFONT\"/" ${var_TARGET_DIR}/etc/rc.conf
-} \ No newline at end of file
+}
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 812753e..ae3ccd2 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -106,8 +106,8 @@ interactive_time () {
NEXTITEM=
while true; do
- dohwclock $HARDWARECLOCK hctosys
- current=`date`
+ dohwclock $HARDWARECLOCK hctosys $TIMEZONE
+ current=$(TZ=$TIMEZONE date)
default=no
[ -n "$NEXTITEM" ] && default="$NEXTITEM"
#TODO: only propose if network ok