doujinge9648 2016-08-11 10:33
浏览 367
已采纳

在Unix纪元php中获取纳秒时间戳[重复]

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>
  • 写回答

1条回答 默认 最新

  • douhu7807 2016-08-11 10:37
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?