How can i get time of my recorded audio in iphone?

A couple of the answers here use the same really poor time formatting that gives results like "0.1" for 1 second elapsed or "0.60" for 1 minute. If you want something that gives you a normal looking time like 0:01 or 1:00 then use this:

let minutes = Int(audioRecorder.currentTime / 60)
let seconds = Int(audioRecorder.currentTime) - (minutes * 60)
let timeInfo = String(format: "%d:%@%d", minutes, seconds < 10 ? "0" : "", seconds)

My solution is simply to keep track of the start date, and at the end, calculate the time passed. It worked for me because the user is starting and stopping the recorder.

In the recorder class

NSDate* startTime;
NSTimeInterval duration;

-(void) startRecording
{
   //start the recorder
   ...
   duration = 0;
   startTime = [NSDate date];

}

-(void) stopRecording
{
   //stop the recorder
   ...
   duration = [[NSDate date] timeIntervalSinceDate:startRecording];
}

If you are using AVAudioPlayer with AVAudioRecorder than you can get the audioPlayer.duration and get the time.

like this.

 NSError *playerError;

 audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:yoururl error:&playerError];

 NSlog(@"%@",audioPlayer.duration);

But only if you are using AVAudioPlayer with AVAudioRecorder.

UPDATE

Or you can do like this.

//put this where you start recording
     myTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTime) userInfo:nil repeats:YES];

// a method for update
- (void)updateTime {
    if([recorder isRecording])
    {

        float minutes = floor(recorder.currentTime/60);
        float seconds = recorder.currentTime - (minutes * 60);

        NSString *time = [[NSString alloc] 
                                    initWithFormat:@"%0.0f.%0.0f",
                                    minutes, seconds];
    }
}

steel you can get some delay becouse their is some microsecond value,and i dont know how to clip it .but thats all.