标签:for col oid long class nbsp form return att
package com.project.model.work; public class DateFormat { /* * 毫秒转化时分秒毫秒 */ public static String formatTime(Long ms) { Integer ss = 1000; Integer mi = ss * 60; Integer hh = mi * 60; Integer dd = hh * 24; Long day = ms / dd; Long hour = (ms - day * dd) / hh; Long minute = (ms - day * dd - hour * hh) / mi; Long second = (ms - day * dd - hour * hh - minute * mi) / ss; Long milliSecond = ms - day * dd - hour * hh - minute * mi - second * ss; StringBuffer sb = new StringBuffer(); if(day > 0) { sb.append(day+"天"); } if(hour > 0) { sb.append(hour+"小时"); } if(minute > 0) { sb.append(minute+"分"); } if(second > 0) { sb.append(second+"秒"); } if(milliSecond > 0) { sb.append(milliSecond+"毫秒"); } return sb.toString(); } public static void main(String[] args) { System.out.println(formatTime(78640000l));; } }
标签:for col oid long class nbsp form return att
原文地址:https://www.cnblogs.com/iscys/p/9524321.html