When using NSDateFormatter
with doesRelativeDateFormatting
turned on, all relative formatting seems to be relative to the current system time. I would like to format dates with relative formatting, such as "Today" or "Tomorrow", but relative to an arbitrary "current" time instead of the actual time.
For example, I would like to specify an NSDate
of November 2, 2015, with November 1, 2015 as the "current" time, and have it formatted as "Tomorrow" instead of "November 2, 2015". Can NSDateFormatter
do this?
it is always relative to the system date. sorry.
BUT
there is https://github.com/billgarrison/SORelativeDateTransformer that might be able to do this. maybe you can get code from there
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加