Possible Duplicate:
How to get current time in ms in PHP?
I am trying to figure out the best way to get the current time in milliseconds. As a company I am doing work for stores milliseconds in a database as they lay claim that its more accurate as far as UTC conversion goes. They obtain most of these times via javascripts date function. So what I am trying to figure is what is the best way to do this php side. I see mixed results.
time()*1000 seems to be popular, but for me that doesnt make sense, as your ending up with a normal timestamp with 3 additional zeros at the end, which yea thats closer to accurate, but still not exact. I have also seen
microtime(time(), TRUE) or something to the extent there of, but that returns a result with a decimal from what I gather. Which again isn’t up to par with what I am looking for. That said. Whats the best approach to getting a javascript readable version of a javascript style timestamp created by PHP on the fly?
microtime(time(), TRUE)is not valid andtime()*1000would not give you the best resultYou can try
Javascript
PHP