This question already has an answer here:
PHP strtotime
gives unix timestamp, but how to get the nanosecond timestamp in unix epoch. I want to get it to store it in my influxdb.
</div>
This question already has an answer here:
PHP strtotime
gives unix timestamp, but how to get the nanosecond timestamp in unix epoch. I want to get it to store it in my influxdb.
</div>
收起
PHP does not provide a function that has higher precision than microseconds, unfortunately. The UNIX timestamp, according to the standard, is stored in microseconds.
However, there is a platform-dependent solution. Use
system('date %N');
on a linux machine. See man date or this page for more info.
报告相同问题?