I had this working on Ubuntu but I'm now trying to run the script on OSX but it seems that the formatting of date is different.
Originally I had:
date -d "$MODDATE" +%F" "%H":"%M
$MODDATE is a unix timestamp generated with stat
However the above date function doesn't work the same way on BSD versions. How can I convert the timestamp to the date in the following format: YYYY-MM-DD HH:MM ?