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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:39:51+00:00 2026-05-19T02:39:51+00:00

I am developing one GPS Application. Which will send the location data to server

  • 0

I am developing one GPS Application. Which will send the location data to server for every one hour.

In this I am using following code:

location.getLatitude();
location.getLongitude();
location.getTime();

with this code I am getting Latitude and Longitude correctly and Time also, but I am getting some 13 digits number instead of the time. I done some research on that, I found that is an seconds for of the current time.

so now I need to convert that 13 digit number in to the specific format.

  • 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-19T02:39:52+00:00Added an answer on May 19, 2026 at 2:39 am

    Location#getTime() returns “the UTC time of this fix, in milliseconds since January 1, 1970.”

    This is exactly the same behavior as java.util.Date#getTime(). I’m not clear on what you’d like to do with this time data, but if you’d like to convert the Location‘s time into a java.util.Date, you can do it like this:

    long time = location.getTime();
    Date date = new Date(time);
    

    Now it is somewhat easier to work with. If you’d like to create a particular string output format of that date, use SimpleDateFormat:

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String text = sdf.format(date);
    System.out.println(text); // prints something like 2011-01-08 13:35:48
    

    That said, if all you’d like to do is get the current time (which is what it sounds like you’re trying to do) you don’t need a Location at all:

    Date now = new Date();
    

    That’s it!


    Does that help? If not, could you clarify what you’re trying to do?

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

Sidebar

Related Questions

I am developing one iPhone application where I need to send some data (in
I am developing one web application using CakePHP , I will be providing one
I'm developing one android application in which I'm using one customized ListView which extends
I'm developing one AS3 application in which I need to add blank editable box
hello friends i am developing one intranet application called human resource information system using
I'm developing one web application, using PHP eclipse IDE. For an instance i want
I am new to iPhone apps, I am developing one application which requires playing
I'm developing an application which requires two interfaces - one for mobile phones browsers
Im developing one application which used SeekBar to control volume in MediaPlayer. The problem
i am developing one app which will login to vonage website and do some

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.