Convert unix epoch time to human readable date on Mac OSX – BSD
Here you go: # date -r 123439819723 ‘+%m/%d/%Y:%H:%M:%S’ 08/26/5881:17:48:43 In a bash script you could have something like this: if [[ “$OSTYPE” == “linux-gnu”* ]]; then dayOfWeek=$(date –date @1599032939 +”%A”) dateString=$(date –date @1599032939 +”%m/%d/%Y:%H:%M:%S”) elif [[ “$OSTYPE” == “darwin”* ]]; then dayOfWeek=$(date -r 1599032939 +%A) dateString=$(date -r 1599032939 +%m/%d/%Y:%H:%M:%S) fi