What is a timestamp?
A timestamp (timestamp), usually a sequence of characters that uniquely identifies a moment in time. Digital Timestamp technology is a variant application of digital signature technology.
Thinking: Simply speaking is based on the file hash encryption generated by the digest and time generated time voucher, its value is from 1970 year 1 months 1 days 8 points to the current time total number of milliseconds
How do I convert a timestamp to nsdate in Objective-C?
1 nsstring*str=@ "1283376197"; 2 nstimeintervaltime=[str doublevalue]; 3 nsdate*detaildate=[nsdate datewithtimeintervalsince1970:time]; 4 NSLog (@ "date:%@", [detaildatedescription]);
Thinking: Using this function, the double value of the time stamp is passed to get the nsdate time
How do I convert the current time to a timestamp?
1NSDate *datenow =[nsdate Date];//now time, you can output to see what the format is2Nstimezone *zone =[Nstimezone Systemtimezone];3Nsinteger interval =[Zone Secondsfromgmtfordate:datenow];4NSDate *localedate =[Datenow Datebyaddingtimeinterval:interval];5NSString *timesp = [NSString stringWithFormat:@"%d", (Long) [Localedate timeIntervalSince1970]];6NSLog (@"timesp:%@", TIMESP);//value of time stamp
The timestamp of objective-c is 1000 times times the time stamp of Java, and the timestamp of objective-c is divided by the time stamp of Java by 1000.
iOS Development--Timestamp issues