Home:ALL Converter>PHP - unix timestamp from seconds to milliseconds

PHP - unix timestamp from seconds to milliseconds

Ask Time:2017-08-17T17:43:20         Author:Michael

Json Formatter

So I need to convert an unix timestamp which is in seconds to milliseconds. This line seems to be not working

$unixtime = strtotime($timestamp_conv."+3 hour") * 1000;

I basically need a 13 digit timestamp. Any ideas what I'm doing wrong?

Thanks

Author:Michael,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45731690/php-unix-timestamp-from-seconds-to-milliseconds
Sirko :

As per the comments, $timestamp_conv already is a (second-)timestamp, you want to convert to a (milliseconds-)timestamp. You, however, also try to add some offset (3 hours) to it.\n\nWith simple arithmetics this would look like this\n\n// add the three hours: 3 hours of 60 minutes of 60 seconds each\n$timestamp_conv += 3 * 60 * 60;\n\n// convert to milliseconds base\n$unixtime = $timestamp_conv * 1000;\n",
2017-08-17T09:52:16
yy