This number is in seconds from 00:00:00 UTC on January 1, 2001. It must come from NSDate.
NSDate objects encapsulate a single point in time, regardless of any particular calendar system or time zone. Date objects are immutable, representing an invariant time interval relative to the absolute key date (00:00:00 UTC January 1, 2001).
- Link to the NSDate class
To get a decent human value, you must add 978307200(era 2001-01-01 00:00:00).
This request should provide you with what you want:
.headers on
select datetime(v.visit_time + 978307200, 'unixepoch', 'localtime') as date, v.visit_time + 978307200 as epoch, v.visit_time, i.domain_expansion, i.url
from history_items i left join history_visits v on i.id = v.history_item
order by i.id desc
limit 100;
Output Example:
date|epoch|visit_time|domain_expansion|url
2015-12-31 11:51:27|1451562687.28465|473255487.284646|duckduckgo|https://duckduckgo.com/?q=current+timestamp+2015-12-31+11:51&t=osx
PS: For future reference, the Safari db file is in ~/Library/Safari/History.db
source
share