当前位置: 首页>>代码示例>>PHP>>正文


PHP Time::seconds_to_dhms方法代码示例

本文整理汇总了PHP中Time::seconds_to_dhms方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::seconds_to_dhms方法的具体用法?PHP Time::seconds_to_dhms怎么用?PHP Time::seconds_to_dhms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Time的用法示例。


在下文中一共展示了Time::seconds_to_dhms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: format_succinct

 public static function format_succinct($time)
 {
     $time_arr = Time::seconds_to_dhms($time);
     $time_str = isset($time_arr["days"]) ? $time_arr["days"] . "d " : "";
     $time_str .= isset($time_arr["hours"]) ? $time_arr["hours"] . "h " : "";
     $time_str .= isset($time_arr["minutes"]) ? $time_arr["minutes"] . "m " : "0m ";
     $time_str .= isset($time_arr["seconds"]) ? sprintf('%02d', $time_arr["seconds"]) . "s " : "00s ";
     return $time_str;
 }
开发者ID:radiowarwick,项目名称:digiplay,代码行数:9,代码来源:Time.php

示例2: get_total_length_formatted

 public static function get_total_length_formatted()
 {
     $time_arr = Time::seconds_to_dhms(Sustainer::get_total_length());
     $time_str = $time_arr["days"] ? $time_arr["days"] . " days, " : "";
     $time_str .= $time_arr["hours"] ? $time_arr["hours"] . " hours, " : "";
     $time_str .= $time_arr["minutes"] ? $time_arr["minutes"] . " minutes, " : "";
     $time_str .= $time_arr["seconds"] ? sprintf('%02d', $time_arr["seconds"]) . " seconds " : "00s ";
     return $time_str;
 }
开发者ID:radiowarwick,项目名称:digiplay,代码行数:9,代码来源:Sustainer.php

示例3: get_length_formatted

 public function get_length_formatted()
 {
     $time_arr = Time::seconds_to_dhms($this->get_length());
     $time_str = isset($time_arr["days"]) ? $time_arr["days"] . "d " : "";
     $time_str .= isset($time_arr["hours"]) ? $time_arr["hours"] . "h " : "";
     $time_str .= isset($time_arr["minutes"]) ? $time_arr["minutes"] . "m " : "0m ";
     $time_str .= isset($time_arr["seconds"]) ? sprintf('%02d', $time_arr["seconds"]) . "s " : "00s ";
     return $time_str;
 }
开发者ID:radiowarwick,项目名称:digiplay,代码行数:9,代码来源:Audio.php


注:本文中的Time::seconds_to_dhms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。