• 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
NSDateFormatter, timezones and early dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDateFormatter, timezones and early dates


  • Subject: NSDateFormatter, timezones and early dates
  • From: Gideon King <email@hidden>
  • Date: Wed, 01 Feb 2012 14:26:50 +1000

I have just come across a really unexpected thing. I have a date formatter like so:

    NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
    [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZ"];

Now when I use:

    [formatter stringFromDate:aDate];

It works fine for dates after 1895, but for dates before that, the string is incorrect - around here it should end in +1000, but for dates before 1895, it gives +101208.

Is there some way I can get this so that it gives the expected result for all dates?

Thanks


Gideon








_______________________________________________

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: NSDateFormatter, timezones and early dates
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Transparent window not getting mouse down events
  • Next by Date: Re: How to deactivate an app
  • Previous by thread: Re: Transparent window not getting mouse down events
  • Next by thread: Re: NSDateFormatter, timezones and early dates
  • Index(es):
    • Date
    • Thread