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

在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>

图片转代码服务由CSDN问答提供 功能建议

此问题已经存在 这里有一个答案:

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

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.

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题