Time stamp from PHP to JS processing I say how always not on the number, the original JS time stamp is 13 bits, contains 3-bit milliseconds, and PHP only 10 bits does not contain milliseconds.
var nowtime = (new Date). GetTime ()/* current timestamp/////
* Conversion time, calculated difference *
/function Comptime (begintime,endtime) {
var Secondnum = parseint ((endtime-begintime*1000)/1000);//calculated timestamp difference
if (secondnum>=0&&secondnum<60) { return
secondnum+ ' seconds ago ';
}
else if (secondnum>=60&&secondnum<3600) {
var ntime=parseint (SECONDNUM/60);
return ntime+ ' minutes ago ';
}
else if (secondnum>=3600&&secondnum<3600*24) {
var ntime=parseint (secondnum/3600);
Return ntime+ ' hour ago ';
}
else{
var ntime = parseint (secondnum/86400);
return ntime+ ' days ago ';
}
t = comptime (timestamp,nowtime);//timestamp timestamp for PHP via Ajax