开发者

PHP UTC Timestamp Creation

开发者 https://www.devze.com 2022-12-29 06:08 出处:网络
I am using ubuntu(apache) for my php application.i need to create a timestamp for authenticated call of a webservice.In php i getting only 10 digit timestamp like 1273229733.But i need to create like

I am using ubuntu(apache) for my php application.i need to create a timestamp for authenticated call of a webservice.In php i getting only 10 digit timestamp like 1273229733.But i need to create like 1开发者_StackOverflow中文版273229613000 .How can i solve this problem.help me please.


The thirteen-digit timestamp is the number of milliseconds (1/1,000) since the Unix epoch (compared to the ten-digit seconds since). PHP has a function to return the timestamp to the microsecond (1/1,000,000) which we can multiply and truncate to get our thirteen-digit timestamp.

$millitimestamp = floor(microtime(TRUE) * 1000);
0

精彩评论

暂无评论...
验证码 换一张
取 消