• 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
RFC822 date-string to NSDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC822 date-string to NSDate


  • Subject: RFC822 date-string to NSDate
  • From: Steve Byan <email@hidden>
  • Date: Mon, 30 Jun 2008 14:35:20 -0400

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@hidden>
Littleton, MA 01460


_______________________________________________

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: RFC822 date-string to NSDate
      • From: Nick Zitzmann <email@hidden>
    • Re: RFC822 date-string to NSDate
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: [NSMutableAttributedString] How is NSBaseURLDocumentOption supposed to work?
  • Next by Date: Re: RFC822 date-string to NSDate
  • Previous by thread: Re: garbage collection and NSConnection
  • Next by thread: Re: RFC822 date-string to NSDate
  • Index(es):
    • Date
    • Thread