getUTCHours

getUTCMinutes() 方法可根据世界时 (UTC) 返回时间的分钟字段。

    function timeFormat(ms){
        if (!ms) return 0;
        var date = new Date(ms),
            h = date.getUTCHours(),
            m = date.getUTCMinutes(),
            s = date.getUTCSeconds(),
            timeStr = '';

        if (h) timeStr += h +'小时';
        timeStr += m +'' + s + '';
        return timeStr;
    }
timeFormat(毫秒数);

 

posted @ 2014-11-19 17:11  丑萌嘞  阅读(146)  评论(0编辑  收藏  举报