我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何只显示第二个时间段所需的时间

I currently have this function running to show the time by days, hours minutes etc. However I want to go from the code below to only showing the days, hours & minutes if they are above 1, otherwise to not show it.

function secondsToTime($seconds) {
    $dtF = new DateTime("@0");
    $dtT = new DateTime("@$seconds");
    return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}

近期文章

  • 确认页面重定向到原始页面并显示为JS通知
  • 发送大量通知
  • 从DB中保存的邮件中删除URL
  • PHP curl,1ms超时 - 足够的时间让目标的ignore_user_abort(true)激活?
  • 如何使用Volley库在PHP站点服务器上接收JSONObject?
  • 使用php检索不同年份
  • 您可以通过php函数将值分配给表单中的隐藏字段,以存储在数据库中吗?
  • 无法使用php将文件上传到S3
  • 将CSV加载到mysql中
  • 如何在不刷新整个页面的情况下从不同页面获取数据
  • 当数据使用PHP交叉时,将数据从一个MySQL表复制到另一个MySQL表
  • 如何在PHP上为paypal项创建一个多维数组,我想从我的会话项循环该项
  • 在编辑PHP时显示文件的现有内容
  • 问题使用fsockopen()在两个VPS之间
  • 如何设置值是函数是空的?
  • PHP调用未定义的方法DOMElement
  • 为什么printer_list功能不起作用
  • 如何知道选择哪个选项PHP
  • Laravel 5.2,Eloquent&Infinite Descendants
  • 在php上提交的特定邮件ID上发送表单信息

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华