[Python] Format the iCloud Timestamp

Discussão em 'Python' iniciado por Stack, Julho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I'm accessing the iCloud API via python with pyiCloud.

    When I pull my iPhone's GPS location with the API I get this:

    >>> api.iphone.location()
    {u'timeStamp': 1384188010186L, u'locationFinished': True, u'longitude': -0.14189, u'positionType': u'GPS', u'locationType': None, u'latitude': 51.501364, u'isOld': False, u'horizontalAccuracy': 5.0}


    This is exactly the info I need. The issue I am having is figuring out how to convert that time stamp to something that makes sense. I'm confident that I have saw this time format before and converted it, but as of right now I can't figure it out.

    I'd really like an explanation on this format, is it UTC or the ticks since 2000?

    The format I am looking for something like: YYYYMMDD HH:MM:SS AM/PM

    Continue reading...

Compartilhe esta Página