Ordering mixed Chrome History rows (urls + downloads) chronologically without displaying converted dates
Chrome's History SQLite stores times as WebKit microseconds since 1601-01-01 UTC (urls.last_visit_time, downloads.start_time, visits.visit_time). To show urls and downloads rows in one chronological list, sort on the raw value; converting is only needed for comparison: seconds = value/1e6 - 11644473600. Guard the range (about 1.2e16 to 1.9e16) because 0 means 'not set'. If your evidence policy forbids presenting converted raw times as facts, use the conversion only as a sort key and keep showing the raw value. When some records in a group carry ISO timestamps and others don't, put the timed ones first and order the rest by a natural sort of their locator ('row 9' before 'row 10': split on digit runs and compare them as ints), then report back which ordering was used so the UI can say so. Compare ISO timestamps as UTC datetimes, not strings, or '23:00+02:00' sorts after '21:17Z'.