android通过秒换算成时分秒
来源:互联网 发布:淘宝生活研究所怎么上 编辑:程序博客网 时间:2024/05/10 12:12
<p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"></span></p><p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">//把秒转换成时分秒</p><p style="margin: 10px auto; padding-top: 0px; padding-bottom: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">public static String cal(int second) {</span></p> int h = 0; int d = 0; int s = 0; int temp = second % 3600; if (second > 3600) { h = second / 3600; if (temp != 0) { if (temp > 60) { d = temp / 60; if (temp % 60 != 0) { s = temp % 60; } } else { s = temp; } } } else { d = second / 60; if (second % 60 != 0) { s = second % 60; } } return h + "时" + d + "分" + s + "秒"; }
通过秒分别得出多少小时多少分多少秒
public class TimeUtils {
public static String getHours(long second) {//计算秒有多少小时
long h = 00;
if (second > 3600) {
h = second / 3600;
}
return h+"";
}
public static String getMins(long second) {//计算秒有多少分
long d = 00;
long temp = second % 3600;
if (second > 3600) {
if (temp != 0) {
if (temp > 60) {
d = temp / 60;
}
}
} else {
d = second / 60;
}
return d + "";
}
public static String getSeconds(long second) {//计算秒有多少秒
long s = 0;
long temp = second % 3600;
if (second > 3600) {
if (temp != 0) {
if (temp > 60) {
if (temp % 60 != 0) {
s = temp % 60;
}
} else {
s = temp;
}
}
} else {
if (second % 60 != 0) {
s = second % 60;
}
}
return s + "";
}
}
public static String getHours(long second) {//计算秒有多少小时
long h = 00;
if (second > 3600) {
h = second / 3600;
}
return h+"";
}
public static String getMins(long second) {//计算秒有多少分
long d = 00;
long temp = second % 3600;
if (second > 3600) {
if (temp != 0) {
if (temp > 60) {
d = temp / 60;
}
}
} else {
d = second / 60;
}
return d + "";
}
public static String getSeconds(long second) {//计算秒有多少秒
long s = 0;
long temp = second % 3600;
if (second > 3600) {
if (temp != 0) {
if (temp > 60) {
if (temp % 60 != 0) {
s = temp % 60;
}
} else {
s = temp;
}
}
} else {
if (second % 60 != 0) {
s = second % 60;
}
}
return s + "";
}
}
0 0
- android通过秒换算成时分秒
- Excel 时分秒 换算成秒
- 时分秒换算
- 分钟换算成时分秒格式
- javascript将秒数换算成时分秒
- 把总秒数换算成时分秒的形式
- js时间 比较 js将秒数换算成时分秒
- Android时分秒计时器
- 时分秒
- android 倒计时显示时分秒
- Android 倒计时(时分秒)
- Android获取年月日时分秒
- Android 毫秒转为时分秒
- android模拟时分秒记时
- Excel中秒转化成时分秒
- 将秒转换成时分秒
- JS将秒转化成时分秒
- 把秒数转换成时分秒
- jdk环境变量
- Linux下的段错误(Segmentation fault)产生的原因及调试方法(经典)
- HttpServletRequest中得到各种信息
- 可以读取较大的图片而不会内存溢出了
- Windows 各种计时函数总结
- android通过秒换算成时分秒
- Python版本需要是2.7
- spring 数据源JNDI 基于tomcat mysql配置
- 获取软连接指定的真实文件名
- iOS开发:使用Block在两个界面之间传值(Block高级用法:Block传值)
- iOS 图片扫描(Moodstocks)
- 简单字典树Trie
- 证书的签发者无效的问题
- MQTT协议详解,非常易懂