How to display time in Objective C

I have an application in Objective-C. I have an NSDate, of 2014-01-01, which I have displayed on the screen.

What I want is a way to increment the date after a time interval. For example, every 5 seconds, the date should increment by one day.

I want this to happen independently of other tasks, maybe on another thread. I will have other operations happening during this date updating.

EDIT: Solved!


Use NSTimer When it fires, change the date. But you need to read about NSDate. What you have is implicitly midnight. NSDate is an exact point in time and that means time is part of it. NSTimeZone is also part of it. NSCalendar as well. Together they give you a human readable value from an NSTimeInterval value which is what NSDate wraps in an object and is the number of seconds since the reference date positive or negative.

The problem is some dates have no midnight and some have two. So implicit midnight will screw up calendrical calculation. Set the time to noon. Then use one of the awesome new methods in 10.9 but only in the NSDate.h header and not in the docs still.

Need Your Help

Force frontpage language

ajax multilingual joomla2.5

I have got a multilingual joomla 2.5 website with sef urls enabled. The page relies heavily on ajax, so every kind of content is pulled from the server after the good old

Fast Multiplication Code in C


I am studying multiplication source code and I don't understand this function for multiplying x*A. Please help me to understand this with any numeric example please?