views:

195

answers:

1

Hello,

In my iPhone application, I need to calculate the time difference between the time a message was created on the server, and the time my phone received it.

The server (Java) puts in a number returned by System.currentTimeMillis() as metadata along with the message.

How do I compare this number with the current time on the device? Could not find a suitable NSDate method to do this comparison.

Thanks in advance!

+1  A: 

You might take a look at this SO answer and the -timeIntervalSinceDate: method.

Alex Reynolds