js 将秒数转换为时分秒的格式
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js 将秒数转换为时分秒的格式相关的知识,希望对你有一定的参考价值。
参考技术A 使用js方法将要处理的秒数处理为时分秒的格式c语言将秒数转换为时间格式(24小时制,00:00:00格式)
main()
int t,th,tm,ts;
while(1)
scanf("%d",&t);
th=t/3600;
tm=(t-th*3600)/60;
ts=t-th*3600-tm*60;
printf("%02d:%02d:%02d\\n",th,tm,ts);
如图所示,望采纳。。。。。。
int main()
int n;
while(scanf("%d",&n)!=EOF)
printf("%02d:%02d:%02d\\n",n/3600,n%3600/60,n%60);
return 0;
以上是关于js 将秒数转换为时分秒的格式的主要内容,如果未能解决你的问题,请参考以下文章