From cab2850f364367845114f87115df05f4e0e01541 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 23 Jan 2010 18:31:01 -0500 Subject: Use saner conversion of epoch to human readable timestamps --- squashfu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'squashfu') diff --git a/squashfu b/squashfu index c3c94f1..5d20085 100755 --- a/squashfu +++ b/squashfu @@ -292,7 +292,7 @@ action_remove_bin () { local timestamp=$(sed -n "/^$1:/s/^[0-9]*:\([0-9]*\)/\1/p" "${BINVENTORY}") printf "\t%15s %s\n\t%15s %s\n\t%15s %s\n" \ "Bin:" "$1" \ - "Date Created:" "$(date --rfc-3339=seconds --date="1970-01-01 $timestamp sec GMT")" \ + "Date Created:" "$(date --rfc-3339=seconds --date="@$timestamp")" \ "Size:" "$(du -sh "${BINS_DIR}/$1" 2>/dev/null | awk '{print $1}')" read -p "Confirm deletion (y/N)" confirm @@ -343,7 +343,7 @@ action_rollback () { local rb_timestamp=$(grep -E "^${bin_list[@]:(-$num_to_mount):1}:" "$BINVENTORY" | cut -d: -f2) - info "You have rolled back to $(date --rfc-3339=seconds --date="1970-01-01 $rb_timestamp sec GMT")" + info "You have rolled back to $(date --rfc-3339=seconds --date="@$rb_timestamp")" info "Your files can be found at '${UNION_MOUNT}'" } @@ -363,7 +363,7 @@ action_report () { printf "%10s\t%25s\t%7s\n" "Bin ID" "Date Created" "Size" grep -vE "^[\t ]*$" "$BINVENTORY" | sort -r -t: -k2 -n | while read bin stamp; do printf "%10d\t%25s\t%7s\n" "$bin" \ - "$(date --rfc-3339=seconds --date="1970-01-01 $stamp sec GMT")" \ + "$(date --rfc-3339=seconds --date="@$stamp")" \ "${DATA[$bin]}" done IFS=$OLDIFS -- cgit v1.2.3