Re: A few questions about dates
Re: A few questions about dates
- Subject: Re: A few questions about dates
- From: Doug McNutt <email@hidden>
- Date: Sun, 27 Aug 2006 13:03:03 -0600
At 10:25 -0400 8/27/06, Sweth Chandramouli wrote:
>None of these are the actual value of the date in seconds, though. FWIW, in the end, I decided to punt on using AppleScript for my current problem, and figured out how to use Glue::Mac w/ Perl (my lang of choice); once I did that, I was able to fetch the date value directly, and confirm that it does, in fact, use Unix epoch seconds for dates (at least under 10.4.7, but I'd imagine that it's been the case since OS X was rolled out).
On OS neXt, the perl time() function returns the UNIX epoch seconds (since 1970). And it ignores leap seconds.
The real question is what does the Apple OS use when it stores data? I am using OS 9 right now. and files I save in HFS+ and open on my OS neXt box later seem to be given compatible which means that creation and modification times must be saved in MacOS classic form and that is certainly is 1904 epoch.
There must be an Apple developer note on the subject but the closest I found quickly was for A/UX. I wonder what the other Chris (Nandor) does with MacGlue?
And just in case someone thinks it's a simple concept. . .
From: <http://developer.apple.com/samplecode/MPFileCopy/listing7.html>
// The copy engine is going to set each item's creation date
// to kMagicBusyCreationDate while it's copying the item.
// But kMagicBusyCreationDate is an old-style 32-bit date/time,
// while the HFS Plus APIs use the new 64-bit date/time. So
// we have to call a happy UTC utilities routine to convert from
// the local time kMagicBusyCreationDate to a UTCDateTime
// gMagicBusyCreationDate, which the File Manager will store
// on disk and which the Finder we read back using the old
// APIs, whereupon the File Manager will convert it back
// to local time (and hopefully get the kMagicBusyCreationDate
// back!).
--
--> If it's not on fire it's a software problem. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden