转换秒钟为分钟

php

浏览数:285

2019-1-8

AD:资源代下载服务
/**
     * 转换秒钟为分钟
     * @param $seconds
     * @return string
     */
    public static function convertSecondToTime($seconds) {
        $reminded = strval($seconds % 60);
        $minute = strval(($seconds - $reminded) / 60);
        if(strlen($minute)<2){
            $minute = '0'.$minute;
        }
        if(strlen($reminded)<2){
            $reminded = '0'.$reminded;
        }
        $time = $minute.":".$reminded;
        return $time;
    }