Re: Fastest way to convert an NSDate into an NSString
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