FROM : Andy Lee
DATE : Mon Jun 30 20:50:37 2008
I'm not too familiar with NSDateFormatter. Do you need to call -
setDateFormat:?
--Andy
On Jun 30, 2008, at 2:35 PM, Steve Byan wrote:
> I'm having trouble grokking NSDateFormatter on OS X 10.4. Does it
> support RFC822-style dates? I'm parsing an XML document; here's the
> pertinent code snippet:
>
> NSLog(@"observation_time_rfc822 element end");
> NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]
> init];
> [dateFormatter
> setFormatterBehavior:NSDateFormatterBehavior10_4];
> myObservationTime = [dateFormatter
> dateFromString:myCurrentStringValue];
> NSLog(@"myObservationTime %@", myObservationTime);
> myObservationTimeRFC822 = [[NSString alloc]
> initWithString:myCurrentStringValue];
>
> The myObservationTimeRFC822 string is "Mon, 30 Jun 2008 13:56:00
> -0400 EDT", but NSLog(@"myObservationTime %@", myObservationTime)
> prints "myObservationTime 1969-12-31 19:00:00 -0500".
>
> Best regards,
> -Steve
>
> --
> Steve Byan <<email_removed>>
> Littleton, MA 01460
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/<email_removed>
>
> This email sent to <email_removed>
DATE : Mon Jun 30 20:50:37 2008
I'm not too familiar with NSDateFormatter. Do you need to call -
setDateFormat:?
--Andy
On Jun 30, 2008, at 2:35 PM, Steve Byan wrote:
> I'm having trouble grokking NSDateFormatter on OS X 10.4. Does it
> support RFC822-style dates? I'm parsing an XML document; here's the
> pertinent code snippet:
>
> NSLog(@"observation_time_rfc822 element end");
> NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]
> init];
> [dateFormatter
> setFormatterBehavior:NSDateFormatterBehavior10_4];
> myObservationTime = [dateFormatter
> dateFromString:myCurrentStringValue];
> NSLog(@"myObservationTime %@", myObservationTime);
> myObservationTimeRFC822 = [[NSString alloc]
> initWithString:myCurrentStringValue];
>
> The myObservationTimeRFC822 string is "Mon, 30 Jun 2008 13:56:00
> -0400 EDT", but NSLog(@"myObservationTime %@", myObservationTime)
> prints "myObservationTime 1969-12-31 19:00:00 -0500".
>
> Best regards,
> -Steve
>
> --
> Steve Byan <<email_removed>>
> Littleton, MA 01460
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Steve Byan | Jun 30, 20:35 | |
| Andy Lee | Jun 30, 20:50 | |
| Nick Zitzmann | Jun 30, 20:54 | |
| Steve Byan | Jun 30, 21:14 | |
| Kyle Sluder | Jun 30, 21:55 |






Cocoa mail archive

