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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:15:01+00:00 2026-06-15T11:15:01+00:00

obj.date is a unix timestamp(long). I’ve checked that the date is correct, but I

  • 0

obj.date is a unix timestamp(long). I’ve checked that the date is correct, but I can’t manage to get the difference in minutes between my two date objects. For example, I get 4, when I’m expecting something close to 30. Why is that?

Date now = new Date();
Date then = new Date((long)obj.date*1000);

int secondsbetweendates = (int) ((then.getTime()-now.getTime())/1000);

int minutesbetweendates = (secondsbetweendates/1000) % 60;
  • 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-15T11:15:02+00:00Added an answer on June 15, 2026 at 11:15 am

    To convert seconds to minutes you can divide by 60:

    int minutesbetweendates = secondsbetweendates / 60;
    

    Note that this returns an integer and truncates the result, meaning that only complete minutes will be counted. In other words 119 seconds will become 1 minute, not 2.

    You should also be aware that it can also return a number greater than 60 if the time difference is more than one hour.

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

Sidebar

Related Questions

I've read a many things about parsing date in obj-c, but I can't find
because obj, the playingCard object is created inside a nested for loop does that
I have a twitter feed and I create a new date obj so I
Can any one please help me how to convert date(02/07/2012) to Tuesday, Febraury 7,
I have a date string in format 08/1999 I want to get the first
This is the output I get from dumpbin AchievementsTable.obj /HEADERS Microsoft (R) COFF/PE Dumper
i want to be get a date (the current hour) from strftime and get
Can anyone please tell me what to do for the following error? 1>Linking... 1>.\Debug\CUDA1.cu.obj
When I call the following function, I get a struct_time obj. Is there a
I have a dataframe like the one below: obj date colour measurement A 01

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.