Latest 1.0.0
License MIT
Platforms ios 7.0, requires ARC
Authors style relative date formatter.

Note: This repo will be deprecated in favour of
some time in the future.


en_GB en_US
Same Day 13:45 1:45 PM
Yesterday Yesterday Yesterday
Same Week Monday Monday
Same Year 15 Mar Mar 15
Last Year 22/04/2013 4/22/13


NSDate *date = ...;
TFGRelativeDateFormatter *formatter = [[TFGRelativeDateFormatter alloc] init];
NSString *relativeString = [formatter stringForDate:date];

TFGRelativeDateFormatter has similar cavets to a NSDateFormatter (it is used
internally) meaning its a good idea to cache instances and not modify the locale.
A handy class method +sharedFormatter is provided to get around this for the
common case where locale is never changed.

NSDate *date = ...;
NSString *relativeString = [[TFGRelativeDateFormatter sharedFormatter] stringForDate:date];

Thread Safety: TFGRelativeDateFormatter is fully thread safe on iOS 7 and
OS X 10.9 (Mordern 64-bit apps). Earlier versions are not however and its recommended
to only use an instance per thread. (More information about thread safety can be
found by reading the NSDateFormatter class reference.)


TFGRelativeDateFormatter is available through
CocoaPods, to install it simply add the following line
to your Podfile:

pod 'TFGRelativeDateFormatter'

Alternatively, simply drag TFGRelativeDateFormatter.h and TFGRelativeDateFormatter.m to your project.


Thomas Guthrie


TFGRelativeDateFormatter is available under the MIT license. See the LICENSE
file for more info.

Latest podspec

    "name": "TFGRelativeDateFormatter",
    "version": "1.0.0",
    "license": "MIT",
    "summary": " style relative date formatter.",
    "homepage": "",
    "social_media_url": "",
    "authors": {
        "Thomas Guthrie": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "source_files": "TFGRelativeDateFormatter",
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"

Pin It on Pinterest

Share This