C# 如何根据秒数计算多少天多少小时多少分钟多少秒

int second = 107653;
int day = second / (3600 * 24);
int hour= second % (3600 * 24) /3600;
int min = second % 3600 / 60;
int sec = second  % 60;
Console.WriteLine("107653 秒是 {0}天{1}小时{2}分钟{3}秒", day, hour, min, sec);
Console.ReadLine();

 

posted @ 2021-04-16 12:13  杨文同学  阅读(1109)  评论(0编辑  收藏  举报