Aadi
Aadi

Reputation: 7109

PHP UTC Timestamp Creation

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 1273229613000 .How can i solve this problem.help me please.

Upvotes: 0

Views: 779

Answers (1)

salathe
salathe

Reputation: 51950

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);

Upvotes: 1

Related Questions