• 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: NSDate / NSXMLParser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSDate / NSXMLParser
      • From: Alexander Spohr <email@hidden>
    • Re: NSDate / NSXMLParser
      • From: Ingvar Nedrebo <email@hidden>
References: 
 >NSDate / NSXMLParser (From: David Rowland <email@hidden>)
 >Re: NSDate / NSXMLParser (From: Nick Zitzmann <email@hidden>)
 >Re: NSDate / NSXMLParser (From: David Rowland <email@hidden>)
 >Re: NSDate / NSXMLParser (From: Nick Zitzmann <email@hidden>)
 >Re: NSDate / NSXMLParser (From: David Rowland <email@hidden>)
 >Re: NSDate / NSXMLParser (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: UIView animation docs question
  • Next by Date: Re: How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
  • Previous by thread: Re: NSDate / NSXMLParser
  • Next by thread: Re: NSDate / NSXMLParser
  • Index(es):
    • Date
    • Thread