Alex Gosselin
Alex Gosselin

Reputation: 2930

What is the proper way to convert a NSTimeInterval to a string, that works internationally?

I know the quick and dirty way of dividing by 60 to get minute, hours, etc

But is there an official way in the API already implemented, and using the appropriate language for minutes, seconds, etc?

Thanks for any help.

Upvotes: 2

Views: 1327

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

Use one of NSDate's -dateWithTimeInterval... methods to create a date from your interval, then hand it to an NSDateFormatter that is configured to display the date formatted as desired.

Upvotes: 4

Related Questions