Found at Erik’s Lab, I found this subroutine while building a script that needed to convert between date/time formats. To use it, just name the UNIX epoch value (it will be a string of numbers like “1207324439″) as a variable called “epochseconds” and pass it through the subroutine. For example, you could call the handler […]

on epoch2datetime(epochseconds)
    --Found at Erik's Lab (http://erikslab.com/2006/09/05/how-to-convert-an-epoch-time-to-a-meaningful-date-and-time/)
    set myshell1 to "date -r "
    set myshell2 to " \"+%m/%d/%Y %H:%M\""
    set theDatetime to do shell script (myshell1 & epochseconds & myshell2)
    return date theDatetime
end epoch2datetime