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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:27:22+00:00 2026-06-01T13:27:22+00:00

In my application, I need to parse a JSON that includes the end time

  • 0

In my application, I need to parse a JSON that includes the end time of an event. When this event is in progress, I need to calculate the time left for the finalization of that evet. To do this I use this piece of code:

// I get the time and convert it from millis to seconds
long end = System.currentTimeMillis() / 1000;                      
techsTime.add((int) (queue.event.get("event0").endtime - end));

Once I’ve the time in seconds, I convert it to d,h,m,s. This is working like a charm in some devices like the Optimus Black and the HTC Desire. But today I’ve tested my app with the ZTE Blade of a friend and the time left of the event is very strange. It appears in negative numbers and digits very distance from the original ones. I’ve tested the app with different values and there’s no pattern, they’re like random numbers, e.g:

Optimus Black -> 21m 32s
ZTE Blade -> -38m -57s

I’ve thought that System.currentTimeMillis() could be different in both devices, but both of them are using CM7 as OS.

  • 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-01T13:27:23+00:00Added an answer on June 1, 2026 at 1:27 pm

    I think the problem might be with the clock of one of the devices not set properly. With the time extracts you give it seems like the difference is exactly one hour, which might be a cause of wrong clock setting. When you consider the time set, also take a look at the time zone. It might be that both devices show the same time, but one of them is configured in different time zone.

    It will be very weird for modern device not to sync its clock in the net, but still possible for ZTE for example.

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

Sidebar

Related Questions

I have an application running on multiple IIS servers that need to parse a
I have this application that need to do some things in protected paths (like
I have a Restlet Service that looks like this: @POST @Produces(application/json) public String processImmediately(String
I have two application that need to talk to each other. App1 needs to
I need to parse JSONP messages in .NET and find JSON in those messages.
I'll try and make this quick: I've an external class that parses the JSON
I have an iPhone application that pulls some JSON data from a server and
In the java web application need to select the file from server and print
Hi every body i am new in iPhone application development. In my application need
In an application I need to execute other programs with another user's credentials. Currently

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.