• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Converting UNIX TIME STAMP to Mac Os X Date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting UNIX TIME STAMP to Mac Os X Date


  • Subject: Converting UNIX TIME STAMP to Mac Os X Date
  • From: Bernardo Hoehl <email@hidden>
  • Date: Sat, 12 Mar 2011 15:19:21 -0300

Helo my friends, 


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


I apreciate your comments on the problem.

Thanks,



Bernardo Höhl
Rio de Janeiro - Brazil
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Converting UNIX TIME STAMP to Mac Os X Date
      • From: Axel Luttgens <email@hidden>
    • Re: Converting UNIX TIME STAMP to Mac Os X Date
      • From: Luther Fuller <email@hidden>
    • Re: Converting UNIX TIME STAMP to Mac Os X Date
      • From: Steve Thompson <email@hidden>
  • Prev by Date: Re: key strokes
  • Next by Date: Re: Converting UNIX TIME STAMP to Mac Os X Date
  • Previous by thread: Re: key strokes
  • Next by thread: Re: Converting UNIX TIME STAMP to Mac Os X Date
  • Index(es):
    • Date
    • Thread