gongzhonghao.png
扫码关注我们
最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

php怎么样生成毫秒时间戳的示例代码

来源:http://erdangjiade.com/topic/496.html 你好,世界。 2017-09-25 22:42浏览(31)

php时间函数time()生成当前时间的秒数,但是在一些情况下我们需要获取当前服务器时间和GMT(格林威治时间)1970年1月0时0分0秒的毫秒数,与Java中的currentTimeMilis()函数一样。

例子:

 public function getCurrentMilis() {
    $mill_time = microtime();    
    $timeInfo = explode(' ', $mill_time);    
    $milis_time = sprintf('%d%03d',$timeInfo[1],$timeInfo[0] * 1000);
    return $time;
  }

以上就是php如何生成毫秒时间戳的示例代码的详细内容,更多请关注二当家的素材网其它相关文章!

评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2