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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:16:29+00:00 2026-06-02T18:16:29+00:00

long d1Ms = current_date.getTime(); long d2Ms = last_time.getTime(); long diff = Math.abs((d1Ms – d2Ms)

  • 0
long d1Ms = current_date.getTime();
long d2Ms = last_time.getTime();
long diff = Math.abs((d1Ms - d2Ms) / 60000);
System.out.println("d1MS: " + d1Ms);
System.out.println("d2MS: " + d2Ms);
System.out.println("Time difference (abs): " + diff)

my current_date & last_time values are.

current_date: Tue Apr 24 11:07:22 IST 2012
last_time:    Mon Apr 23 04:11:48 IST 2012

it displays time difference:1855 but it should be less than 1440 because duration is less than 24 hrs.why it so? and what is the solution to get proper difference?

  • 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-02T18:16:31+00:00Added an answer on June 2, 2026 at 6:16 pm

    1855 is the correct answer:

    11:07:22 - 04:11:48 == ~31 hours == 1855 minutes.
    
    11am on the 23rd - 24 hours is
    11am on the 22nd - ~7 hours is
    4am on the 22nd which is your second date.
    

    Your solution should work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long ago I tried to sort out my system between local, web server and
(Long time reader of SO, first time asking a q. I'm quite new to
long time listener first time caller... I have this function (I don;t recall where
Long time browser, first time asker... Maybe you can help. I've searched and searched,
Long time listener, first time caller here. Ok, I apologize for the length of
Long time mysql/php user, first time Drupal user. Actually, I'm not doing the Drupal
Long time reader, first time poster asks: After many weeks of google and forum
Long long time ago was a Delphi, and any developer can rapidly build win32
long time reader, first time asker... I am making a music app which uses
Long time lurker, first time poster here. My question is: Using C# 2.0, is

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.