Using PHP to Match a Javascript Timestamp

后端 未结 3 1101
面向向阳花
面向向阳花 2021-01-23 04:25

Alright when I do the code:


You get the Unix t

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-23 04:56

    The javascript

    getTime() ;
    

    method returns the number of milliseconds since midnight of January 1, 1970 and the specified date.

    A php equivalent is

    time() * 1000; // not microtime() as I wrongly said earlier.
    

    However they wont match as php does not support millisecond precision it seems.

提交回复
热议问题