Parsing “date” field of iPhone SMS file from backup

后端 未结 8 1532
感动是毒
感动是毒 2021-02-02 00:26

While this isn\'t a programming question per se, it IS related.

So I\'m trying to figure out how to parse the SMS DB that gets backed up from the iPhone. I\'m looking at

8条回答
  •  暖寄归人
    2021-02-02 01:06

    Bohemian♦ is right, but there's a little typo in his answer:

    use %S (capitals) instead of %s, since the time is represented in seconds since 2001 and not 1970!

    Doc from https://www.sqlite.org/lang_datefunc.html

    %s      seconds since 1970-01-01
    %S      seconds: 00-59
    

    select datetime(date + strftime('%S', '2001-01-01 00:00:00'), 'unixepoch', 'localtime') as date, * from message

提交回复
热议问题