Alpha Video Training
Results 1 to 3 of 3

Thread: Decoding Google Maps Timestamp

  1. #1
    Member
    Real Name
    Joe Lavely
    Join Date
    Jun 2013
    Posts
    419

    Default Decoding Google Maps Timestamp

    I have a PhoneGap app that uses the Action Javascript GeoLocation Functions to capture data, including the timestamp that Google Maps provides.

    I am saving the data to a MySQL table.

    I want to display the data in a list control, and from there show markers on a map.

    This is working fine for the latitude and longitude. But I am having trouble with the timestamp.

    Here are some samples of the timestamps I am receiving from an iPhone SE:

    1513123169010.2131
    1513167614524.0479
    1513176386688.052

    What are the decimal and extra numbers?

    In Live Preview running in Mozilla it returns 13 digits, such as

    1513123169010
    1513167614524
    1513176386688

    I can use unixtimestamp_to_time() to convert 10 digits to a readable format. That is as far as I have gone.

    How can I convert these to a format such as MM-dd-yyyy&&0h:0m AM?

    And my next step will be the speed data.

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,569

    Default Re: Decoding Google Maps Timestamp

    The extra digits are just being extremely precise... down to milliseconds... and beyond.

    1513176386688.052 will give you Wednesday, December 13, 2017 9:46:26.688 AM GMT-05:00 using online epoch time converters.


    Even though you're getting more than 10 digits to use... there are limits to unixtimestamp_to_time().

    1513176386688 will result in no return from unixtimestamp_to_time().

    Trimming this down to 10 digits will return today's date.

    You'll see from the Alpha doc that you should use a Time format for the results...

    Code:
    dim myTime as t
    myTime = unixtimestamp_to_time(1513176386)
    will give you 12/13/2017 09:46:25 00 am
    Last edited by Davidk; 12-13-2017 at 01:37 PM.

  3. #3
    Member
    Real Name
    Joe Lavely
    Join Date
    Jun 2013
    Posts
    419

    Default Re: Decoding Google Maps Timestamp

    OK. I was not sure what I was loosing by trimming it down to 10 digits. I now know about www.epochconverter.com.

    I am not quite clear on how the time zone offset is handled. I assume the timestamp will always return the time as it would be in the device's location.

    As I understand it, if I am in Central time, and it is Noon, and a device in Mountain time (11:00 AM) records a timestamp, it will decode as 11:00 AM. Is that correct?

    And if so, I probably need to capture the device's time zone as well.

Similar Threads

  1. Replies: 4
    Last Post: 05-31-2018, 05:10 PM
  2. Google maps using Google API don't show in a panel.
    By Michael1954 in forum Mobile & Browser Applications
    Replies: 4
    Last Post: 07-05-2016, 08:46 AM
  3. Maps Snap to Road in Google Maps
    By chadbrown in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 05-04-2015, 02:04 PM
  4. Google Makes Subtle Change to Google Maps - Breaks Maps in Grids and Dialogs
    By Selwyn Rabins in forum Application Server Version 11 - Web/Browser Applications
    Replies: 14
    Last Post: 07-27-2012, 08:42 AM
  5. Google Maps
    By Toby Locke in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 01-08-2009, 07:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •