Thursday, May 1, 2003

Bingo... finally clicked why some dates are coming through an hour off.

Newton dates are listed in seconds or minutes past January 1, 1904. So that date is the newton's "epoch" (don't worry, I had to look it up in the dictionary too).

I get it through this function:

+ (NSDate *)newtonEpoch

{

return [NSCalendarDate dateWithYear:1904 month:1 day:1 hour:0 minute:0 second:0 timeZone:[NSTimeZone localTimeZone]];

}

Notice the timeZone property; I get the local time zone. I think this is where daylight savings can mess things up; while the current time zone includes daylight savings in its GMT offset, the time zone on Jan 1 wouldn't, because that time of year isn't during daylight savings.

I'll fix that and the repeating dates issue and post an update, sooner or later.
9:44:31 AM    comment []  


Forbes: "Enormously easy to use." Arik Hesseldahl writes in Forbes, “After a short tryout and a tad of obligatory skepticism, we can honestly say we’re impressed. The iTunes Music Store, an online music download service that is integrated into Apple’s iTunes 4 digital jukebox software, is enormously easy to use and dangerously addictive.” [Apr 29] [Apple Hot News] Everybody's completely in love with this service. It's bound to be an enormous success. And yet Apple's stock keeps falling. Go figure.
9:41:42 AM    comment []