I am trying to write a handler that will converter Unix Time Stamp to a Mac Os X formated date.
It should be universal for most locales and work on 10.5 and 10.6, so this is why I am using Unix Time Stamp on my records in a Database.
This script works on 10.6, but will return a crasy date (back to 1974) on 10.5.3:
--UTS = 1299244966 --> "Friday, March 4, 2011 1:22:46 PM"
my convertUnixTimeStamp("1299244966")
on convertUnixTimeStamp(UTS)
set unixTimeStampStarts to current date -- just any date
set time of unixTimeStampStarts to 0
set day of unixTimeStampStarts to 1
set month of unixTimeStampStarts to 1
set year of unixTimeStampStarts to 1970
return unixTimeStampStarts + (UTS as integer)
end convertUnixTimeStamp