Search code examples
iossqlitetimestampitunes

What is this kind of timestamp called and how do I convert it to human-readable dates?


It is used in for example iOS iTunes media library sqlite databases.

551718055 is 2018-06-26 17:00:55

593288552 is 2019-10-20 20:22:32


Solution

  • Those are time intervals using the reference date:

    let timestamp = 593288552
    let date = Date(timeIntervalSinceReferenceDate: timestamp)
    

    Now you can format the date using a DateFormatter as needed for display to the user.