<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A2 Apps &#187; NSDateFormatter</title>
	<atom:link href="http://a2apps.com.au/tag/nsdateformatter/feed/" rel="self" type="application/rss+xml" />
	<link>http://a2apps.com.au</link>
	<description></description>
	<lastBuildDate>Sun, 10 Mar 2013 08:52:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Helper method to convert an NSDate to string</title>
		<link>http://a2apps.com.au/helper-method-to-convert-an-nsdate-to-string/</link>
		<comments>http://a2apps.com.au/helper-method-to-convert-an-nsdate-to-string/#comments</comments>
		<pubDate>Tue, 26 Feb 2013 12:58:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iOS Snippets]]></category>
		<category><![CDATA[NSDate]]></category>
		<category><![CDATA[NSDateFormatter]]></category>
		<category><![CDATA[NSString]]></category>

		<guid isPermaLink="false">http://a2apps.com.au/?p=83</guid>
		<description><![CDATA[For performance reasons we only create the formatter object once, and just reuse it afterwards. The formatter style can be easily tailored by duplicating the method and changing its options; we keep the method&#8217;s name as descriptive as possible of the conversion to be done. It is also a good idea to keep this in <a class="read-more-link" href="http://a2apps.com.au/helper-method-to-convert-an-nsdate-to-string/"><br />...read more</a>]]></description>
				<content:encoded><![CDATA[<p>For performance reasons we only create the formatter object once, and just reuse it afterwards. The formatter style can be easily tailored by duplicating the method and changing its options; we keep the method&#8217;s name as descriptive as possible of the conversion to be done. It is also a good idea to keep this in a category on NSString.</p>
<pre class="brush: objc; title: ; notranslate">

+ (NSString*)dateAsFullDateTime:(NSDate*)date;
{
  static NSDateFormatter * formatter = nil;
  if (formatter == nil) {
    formatter = [[NSDateFormatter  alloc] init];
    [formatter setDateStyle:NSDateFormatterFullStyle];
    [formatter setTimeStyle:NSDateFormatterLongStyle];
    [formatter setDoesRelativeDateFormatting:NO];
  }
  return [formatter stringFromDate:date];
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://a2apps.com.au/helper-method-to-convert-an-nsdate-to-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
