On Nov 3, 2009, at 10:04 AM, Chunk 1978 wrote:

have you tried it on your device?


Yes. The device and the Simulator behave the same way.


On Tue, Nov 3, 2009 at 11:26 AM, David Rowland <rowla...@sbcglobal.net>wrote:

The SeismicXML sample code uses NSXMLParser to extract data from a file downloaded from the USGS. The time of an event appears in the file like
this,
.....12:34:32Z....

According to rfc 822 'Z' means UTC (or GMT if you prefer).

I find that the NSDate from the parser is tagged as being in the Pacific time zone, my local time zone, while the hours are correct for UTC. That
makes it 8 hours off for standard time.

The parser is told that the date format is,
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"];
which seems to ignore the Z and impose local time.

I have tried several variations on that formatting string. They all fail to
deliver UTC.

[dateFormatter setDateFormat:@"yyyy-MM-dd' 'HH:mm:ssz"];   //says PDT
[dateFormatter setDateFormat:@"yyyy-MM-dd' 'HH:mm:ssZ"]; //says -0700
[dateFormatter setDateFormat:@"yyyy-MM-dd' 'HH:mm:sszz"];  //says PDT
[dateFormatter setDateFormat:@"yyyy-MM-dd' 'HH:mm:ss"]; //says nothing
but still thinks its PDT

No doubt my inexperience with the parser or NSDate is at fault. How do I
get the parser to recognize that the time really is UTC?


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/ chunk1978%40gmail.com

This email sent to chunk1...@gmail.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rowlandd%40sbcglobal.net

This email sent to rowla...@sbcglobal.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to