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
where $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 ?
$MODDATE
? There are plenty of differentstat
commands that can produce a variety of formats. If you can get it in number of seconds from the epoch, do that. – Gilles 'SO- stop being evil' Aug 12 '13 at 23:47