将秒转换为分钟和秒 [英] Convert seconds into minutes and seconds

查看:104
本文介绍了将秒转换为分钟和秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将秒转换为分钟和秒?

How can I convert seconds into minutes and seconds?

我知道您可以像这样将秒转换为分钟,但是我不知道如何获得余下的时间...

I am aware that you can convert seconds to minutes like so, but I don't know how I can get the remainder of seconds...

int minutes = seconds / 60;

推荐答案

您将获得有关以下内容的记录:

You will obtain minutes with :

int minutes = totalSeconds / 60;

和剩余秒数:

int seconds = totalSeconds % 60;.

这篇关于将秒转换为分钟和秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆