Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1908] Geolocation timestamp is not in milliseconds

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2013-02-12T21:06:48.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, geolocation, ios, timestamp
ReporterAbhinav Tyagi
AssigneeShak Hossain
Created2013-02-11T17:41:28.000+0000
Updated2016-03-08T07:40:49.000+0000

Description

The timestamp received in location does not seem to be in milliseconds. For eg. we receive timestamp as 1360506558000 where as it should be 1360506558 Observed on iOS as well as android.

Comments

  1. Carter Lathrop 2013-02-12

    Can you please provide a test case that shows the problem? Until then, marked needs more info.
  2. Mostafizur Rahman 2013-12-09

    Hello, When we tested this issue with the test code below, we got expected results. Please check our code sample where I display timestamp value in console. For more information [Click here](http://www.w3schools.com/js/tryit.asp?filename=tryjsref_gettime). Timestamp values are 13 digit in milliseconds format. Hope this clarifies the issue. If you have any question on this, please feel free update this JIRA. If we don't hear back from you, we will assume the issue is resolved and this ticket can be closed. Regards,

    Test Code

        
       Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
       Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;
       Titanium.Geolocation.distanceFilter = 10;
       if (Titanium.Geolocation.locationServicesEnabled === false) {
       	alert('Your device has GPS turned off. Please turn it on.');
       }
       
       Ti.Geolocation.purpose = 'Testig';
       var longitude, latitude, altitude, heading, accuracy, speed, timestamp, altitudeAccuracy;
       
       Titanium.Geolocation.getCurrentPosition(function(e) {
       	if (e.success) {
       
       		longitude = e.coords.longitude;
       		latitude = e.coords.latitude;
       		altitude = e.coords.altitude;
       		heading = e.coords.heading;
       		accuracy = e.coords.accuracy;
       		speed = e.coords.speed;
       		timestamp = e.coords.timestamp;
       		altitudeAccuracy = e.coords.altitudeAccuracy;
       		Ti.API.info('timestamp: ' + timestamp);
       	} else {
       
       		alert(JSON.stringify(e));
       	}
       
       });
        
       
       
    Thanks
  3. Shak Hossain 2013-12-28

    Closing since we got no further activity from Abhinav. A test sample illustrating the issue has been posted.

JSON Source