Re: NSDate / NSXMLParser
Re: NSDate / NSXMLParser
- Subject: Re: NSDate / NSXMLParser
- From: David Rowland <email@hidden>
- Date: Tue, 3 Nov 2009 13:54:37 -0800
Thanks to all for this useful discussion. I think I have solved my
problem by taking the data from the parser as is and then applying a
correction for my offset from GMT when I do my arithmetic. Like this,
int offset = [[NSTimeZone localTimeZone] secondsFromGMT];
NSDate *today = [NSDate date];
NSTimeInterval interval = [today timeIntervalSinceDate:quakeTime] -
offset;
if (interval < 3600) //within the hour
That should be valid everywhere and at any time.
I think it's an error that the parser does not pick up the indicated
time zone 'Z'. Perhaps there is a way, but I tried a number of
formatting strings and none worked.
2009-10-30T18:37:14Z
is a very definite point in time. If the parser picks up
2009-10-30T18:37:14 and interprets it as in the local time zone, that
is not definite. It varies according to where you stand, and that is
strange for a parser, no?
David
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden