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

  • Home
  • SEARCH
  • 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 8653059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:27:07+00:00 2026-06-12T14:27:07+00:00

Possible Duplicate: How to subtract X days from a date using Java calendar? This

  • 0

Possible Duplicate:
How to subtract X days from a date using Java calendar?

This should be fairly simple to answer, but I want to know: if you, for example, added 50 seconds to a Calendar, and the current seconds were 20, would it add 1 minute and set the seconds to 10, or set seconds to 70? Here’s a bit of code to better demonstrate what I mean:

Calendar cal;  
public void test(){  
cal.add(Calendar.SECOND, 50);  
}

So, let’s say that when that code ran, the current second was 20 and the current minute was 10. Would it go to 11 minutes, 10 seconds, or 10 minutes, 70 seconds? Thanks in advance.

  • 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-12T14:27:08+00:00Added an answer on June 12, 2026 at 2:27 pm

    I neither try it, but I expect it will pass to 1 minute and 10 seconds.

    …now i tried and obviously is confirmed :

    public class Test {
    
    public static void main(String[] args) {
        Calendar cal = GregorianCalendar.getInstance();
        System.out.println("Minutes : "+ cal.get(Calendar.MINUTE));
        System.out.println("Seconds :" + cal.get(Calendar.SECOND));
        cal.add(Calendar.SECOND, 50);
        System.out.println("Minutes : "+ cal.get(Calendar.MINUTE));
        System.out.println("Seconds :" + cal.get(Calendar.SECOND));
    }
    

    }

    Printed to my console :

    Minutes : 11
    Seconds :33
    Minutes : 12
    Seconds :23
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Anyone know a simple way using java calendar to subtract X days
Possible Duplicate: Anyone know a simple way using java calendar to subtract X days
Possible Duplicate: How can I subtract a day from a python date? I have
Possible Duplicate: Subtract from an integer using jquery I want to subtract 50 from
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: how to calculate difference between two dates using java I'm trying something
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
Possible Duplicate: In java, in this program it suddenly stops running properly at a
Possible Duplicate: How can I increment a date by one day in Java? I
Possible Duplicate: Calculate date/time difference in java I am a new on Android and

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.