Skip to content

veritech/FRDateFormatterCache

Repository files navigation

FRDateFormatter

Simple category on NSDateFormatter to offer methods to convert dates to and from string.

To convert a date into a string, you use the following

NSString *string = [NSDateFormatter stringWithFormat:@"YYYY" date:[NSDate date]];

And if you wish to do the inverse

NSDate *date = [NSDateFormatter dateWithFormat:@"YYYY" string:@"2015"]

The category will create a date formatter with the given format and keep it in an internal NSCache, reusing it whenever another operation is requested using the same method and format.

Formatters are shared between both methods. So in the examples above only one formatter would be created globally.

Get in Contact

Twitter Email

About

Simple cache category on FRDateFormatter

Resources

License

Stars

Watchers

Forks

Packages

No packages published