Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8538351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:06:31+00:00 2026-06-11T11:06:31+00:00

I need to format seconds and minutes from milliseconds. I am using countdownTimer. does

  • 0

I need to format seconds and minutes from milliseconds. I am using countdownTimer. does anyone have sugestions? I looked at joda time. But all i need is a format so i have 1:05 and not 1:5. thanks

private void walk() {
    new CountDownTimer(15000, 1000) {
        @Override
        public void onFinish() {
            lapCounter++;
            lapNumber.setText("Lap Number: " + lapCounter);
            run();
        }

        @Override
        public void onTick(long millisUntilFinished) {
            text.setText("Time left:" + millisUntilFinished/1000);
        }
    }.start();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:06:32+00:00Added an answer on June 11, 2026 at 11:06 am

    You could do it using the standard Date formatting classes, but that might be a bit heavy-weight. I would just use the String.format method. For example:

    int minutes = time / (60 * 1000);
    int seconds = (time / 1000) % 60;
    String str = String.format("%d:%02d", minutes, seconds);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been creating a time code format from decimal seconds but now need to get
I have a time represented as a floating-point number (in seconds). I need a
Possible Duplicate: How do I format an amount of milliseconds into minutes:seconds:milliseconds in PHP?
I need to display a waiting time, say in minutes and seconds or may
I have a ruby application where i need to get date-time difference in Days-Hours-Minutes
I need to convert time value strings given in the following format to seconds,
I need to format text in posts using WordPress to look like a code.
I'm using the David Walsh PHP calendar script and need to format my date
basically i have a variable that holds a time value, in this format '00:04:13.67'.
Using XSLT 1.0 & receive dates in the following format: 20111129060804 and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.