NSDateFormatter 可以格式化相对于当前时间以外的时间的日期吗?

Can NSDateFormatter format a date relative to a time other than the current time?

当使用 NSDateFormatter 并打开 doesRelativeDateFormatting 时,所有相对格式似乎都是相对于当前系统时间的。我想用相对格式来格式化日期,例如 "Today" 或 "Tomorrow",但相对于任意 "current" 时间而不是实际时间。

例如,我想指定一个 NSDate 2015 年 11 月 2 日,将 2015 年 11 月 1 日作为 "current" 时间,并将其格式化为 "Tomorrow" "November 2, 2015"。 NSDateFormatter 可以做到吗?

它总是相对于系统日期。对不起。

但是

https://github.com/billgarrison/SORelativeDateTransformer 可能可以做到这一点。也许你可以从那里获得代码