It appears you need to calculate a time interval for use with TTTTimeIntervalFormatter
.
And it seems you are starting with a date string in some (unknown to us) format.
Step one is to convert your date string to an NSDate
. Do this using an NSDateFormatter
set to the format matching your string. There are MANY existing topics on how to do this step if you don't already know.
Once you have your "post date" as an NSDate
, you can calculate the interval doing something like this:
NSDate *postDate = ... // the date calculated from your date string
NSTimeInterval interval = [postDate timeIntervalSinceNow];
Now past interval
to your TTTTimeIntervalFormatter
.