Uniformize time display so it includes timezone

date=`date "+%Y-%m-%d %H:%M:%S %Z"`
This commit is contained in:
Thierry Laurion 2022-03-23 16:02:59 -04:00
parent 8f390f97c2
commit 9760181d09
No known key found for this signature in database
GPG Key ID: E7B4A71658E36A93
3 changed files with 6 additions and 6 deletions

View File

@ -156,7 +156,7 @@ generate_totp_htop()
update_totp()
{
# update the TOTP code
date=`date "+%Y-%m-%d %H:%M:%S"`
date=`date "+%Y-%m-%d %H:%M:%S %Z"`
if [ "$CONFIG_TPM" = n ]; then
TOTP="NO TPM"
else
@ -312,7 +312,7 @@ prompt_auto_default_boot()
show_main_menu()
{
date=`date "+%Y-%m-%d %H:%M"`
date=`date "+%Y-%m-%d %H:%M:%S %Z"`
whiptail $BG_COLOR_MAIN_MENU --clear --title "$MAIN_MENU_TITLE" \
--menu "$date\nTOTP: $TOTP | HOTP: $HOTP" 20 90 10 \
'd' ' Default boot' \

View File

@ -27,8 +27,8 @@ if [ -e /sys/class/net/eth0 ]; then
fi
hwclock -w
echo "" > /dev/tty0
echo "UTC/GMT current date and time:" > /dev/tty0
date > /dev/tty0
date=`date "+%Y-%m-%d %H:%M:%S %Z"`
echo "Time: $date" > /dev/tty0
fi
fi
fi

View File

@ -273,7 +273,7 @@ report_integrity_measurements()
if [ $GPG_KEY_COUNT -ne 0 ]; then
# Check and report TOTP
# update the TOTP code every thirty seconds
date=`date "+%Y-%m-%d %H:%M:%S"`
date=`date "+%Y-%m-%d %H:%M:%S %Z"`
seconds=`date "+%s"`
half=`expr \( $seconds % 60 \) / 30`
if [ "$CONFIG_TPM" = n ]; then
@ -320,7 +320,7 @@ report_integrity_measurements()
fi
#Show results
whiptail $MAIN_MENU_BG_COLOR --clear --title "Measured Integrity Report" --msgbox "Time (GMT/UTC timezone): $date\nTOTP: $TOTP | HOTP: $HOTP\n/BOOT INTEGRITY: $HASH\n\nPress OK to continue or Ctrl+Alt+Delete to reboot" 30 90
whiptail $MAIN_MENU_BG_COLOR --clear --title "Measured Integrity Report" --msgbox "$date\nTOTP: $TOTP | HOTP: $HOTP\n/BOOT INTEGRITY: $HASH\n\nPress OK to continue or Ctrl+Alt+Delete to reboot" 30 90
fi
}