• 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: Fastest way to convert an NSDate into an NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fastest way to convert an NSDate into an NSString


  • Subject: Re: Fastest way to convert an NSDate into an NSString
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 25 Jan 2010 12:35:51 -0800


On Jan 25, 2010, at 12:23 PM, Keith Blount wrote:

But either way suffers the same performance hit. So, my question is, does anyone know of a much faster and more efficient way of converting NSDates to NSStrings? (A possible solution would be to change my data model to store these dates as strings internally so that the conversion is already done when they come to be written to file, but I was hoping for a more elegant solution.)

The fastest thing you can do is to store the dates in numeric format, for example as the timeIntervalSinceReferenceDate. (If time-zones matter, you'd also need to save the time zone offset or name as a separate field.)


—Jens_______________________________________________

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


References: 
 >Fastest way to convert an NSDate into an NSString (From: Keith Blount <email@hidden>)

  • Prev by Date: Re: Fastest way to convert an NSDate into an NSString
  • Next by Date: Re: CALayer maybe silly question
  • Previous by thread: Re: Fastest way to convert an NSDate into an NSString
  • Next by thread: NSPopUpButtonCell Update Smashes Focus Ring of Adjacent NSTableView: 10.4 vs. 10.5/10.6
  • Index(es):
    • Date
    • Thread