#!/bin/bash # Contribution from Kent Lewin. set -u declare Platform= # Convert Epoch Time to human-readable format. if [[ -z "${1:-}" ]]; then echo -e "\\nUsage: ${0##*/} \\n\\nwhere is a timestamp in Epoch Time form, e.g. 1735646399.\\n" exit 1 else Platform=$(uname -s) if [[ "$Platform" == "Darwin" ]]; then date -r "$1" +"%Y-%m-%d-%H%M%S" else date -d "@$1" +"%Y-%m-%d-%H%M%S" fi fi