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 723937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:09:55+00:00 2026-05-14T06:09:55+00:00

I am developing a J2ME application (CLDC 1.1 and MIDP 2.0) and I was

  • 0

I am developing a J2ME application (CLDC 1.1 and MIDP 2.0) and I was wondering,
What is the best way to get the time span between 2 dates?

thanks,

Tal.

Edit:

Here is a little sample using the answer below:

public class TimeHelper {
public static long getTimeSpanInMilliSeconds(Date d1,Date d2) {
    return Math.abs(d1.getTime() - d2.getTime());
}

public static double getTimeSpanInMinutes(Date d1,Date d2) {
    return getTimeSpanInMilliSeconds(d1, d2) / 60000;
}

}

  • 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-05-14T06:09:55+00:00Added an answer on May 14, 2026 at 6:09 am

    This is not so easy to answer in general. Do you want the time span in seconds? In this case you could do the following:

    Calendar c1 = ...;
    Calendar c2 = ...;
    long deltaSeconds = (c2.getTime().getTime()-c1.getTime().getTime())/1000;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When developing an application that sends out notification email messages, what are the best
I am developing a J2ME application. I want to split the following string at
We are developing a J2ME application and sometimes we face constraints while working with
I am developing a j2me map based application. Screen is divided into a grid
I am developing a blackberry application using j2me and LWUIT (blackberry port). Everything works
We developing j2me application for low end mobile devices (like Nokia s40 mobiles) which
I am developing a j2me application using LWUIT as GUI .... how can I
I'm developing an application with J2ME Polish using a FramedForm. I'm trying to append
Developing websites are time-consuming. To improve productivity, I would code a prototype to show
Developing a .NET WinForms application: how can I check if the window is in

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.