doujinge9648 2016-08-11 02: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 02: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.

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部