For example: assume NSDate tempdate = "05-23-2013"
. I want this value to be converted into milliseconds.
How can I do this with Objective-C?
alexcristea
AB Bolim
The timeIntervalSince1970
will return seconds from 1970. There are other timeIntervalSince methods if needed.
For reverse conversion, I mean to say from milliseconds to NSDate, refer this stackoverflow article. Convert milliseconds to NSDate
Hope it ll solve your issue.
来源:https://stackoverflow.com/questions/15827657/how-to-convert-nsdate-to-milliseconds-in-objective-c