• 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
Re: Intel, Read/Write, and dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intel, Read/Write, and dates


  • Subject: Re: Intel, Read/Write, and dates
  • From: Harald E Brandt <email@hidden>
  • Date: Tue, 27 Nov 2007 14:36:02 +0100


On 15 okt 2007, at 00.02, Nigel Garvey wrote:

I wrote on Sun, 14 Oct 2007 12:41:42 +0100:

The script below should write the current date to a file on the desktop
and read it back again. Someone on bbs.applescript.net says that the date
returned on their Intel machine is 1st January 1904 00:00:00. Could
anyone here with an Intel machine confirm this bug for me?  Many thanks.

Thanks very much for all the replies, both on and off list. I can get the
same result on a PPC machine by beginning the read in the wrong place, so
maybe the Intels are doing something similar.

One of my suggestions to the bbs.applescript.net poster was to try
reading the file 'as double integer' and adding the result to date "1
January 1904 00:00:00", but he didn't say if that worked or not. He opted
for putting the date in a list or record and writing/reading the result.

(A recap: 
write (current date) as date to fRef
 and then:
  read file filePath as date
 results in 1st January 1904)

I just realized that my software is also plagued with that! But wasn't discovered until now!
I wonder: When did this bug creep up? Has it been with Tiger all the time? Jeeezes...
I am on Leopard, and the ugly bug is definitely there! For how long will it continue to terror us...?

I tried your suggestion 'as double integer' and adding the number directly to the 1904 date, but that does not give the correct result.

However, if I instead write "...as «class isot»", and then read it "as «class isot») as date", then it works!
Also the following works: Make the date into a list, and then read the file as a list! The first item is the correct date!

So, which is the most robust of these two solutions?
Will it work on all machines, and both Tiger and Leopard?

I think I will opt for the list approach. I guess that should work on all machines and the last few OSs.



______heb____________________________
Harald E Brandt     http://bragit.com



 _______________________________________________
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: Intel, Read/Write, and dates
      • From: Philip Aker <email@hidden>
  • Prev by Date: Re: switching user using apple script
  • Next by Date: OmniFocus/Remember the Milk script posted
  • Previous by thread: Re: Repeat until ...the user chooses to stop?
  • Next by thread: Re: Intel, Read/Write, and dates
  • Index(es):
    • Date
    • Thread