Monday, September 27, 2010

How to export Google Chrome History to MS Excel

Google does a good job  of keeping tracking of your history of the web sites you have visited. There are add on's that allow for a enhanced version of history. But what if you want to do some of your own analysis or need to search and sort stuff you do want the data in excel.
Here are some quick pointers. 
Google Chrome keeps your History in a relational database. It uses SqlLite a lightweight database engine. It is used by Google,Firefox and on many mobile devices. You can find the table structure of the history database and and an analysis over here
I did try to setup an ODBC driver and access the tables through excel but could not get excel to read the data.
There are tools like sqllitebrowser. but I found the  FireFox Plugin sqlitemanager works very well.
Most of the date time fields are stored in the UTC use Jan 1 1600 as the epoch date or zero time. i.e the number that you will get is the microseconds from Jan 1 1600. If you want to convert it excel time (Jan 1 1900) you can add the following calculation in the sql statement on the field.
fieldName/(8.64*10e9) - 109205. Found this formula courtesy of this site.

  • (8.64*10^9) is the number of microseconds in a day.
  • 109205 is the number of days, including leap days, between 1601 and 1900. 

Do note that this formula is for GMT and does not compensate for Daylight savings Time.
to calculate to your timezone you need to change the second variable
For timezones ahead of GMT
109205 - (Time Diff with GMT/24)
For timezones behind GMT
109205 +  (Time Diff with GMT/24)
So for India (GMT +5.5) it will be
109205- 5.5/24
For a GMT -1 timezone it will be
109205 + 1/24

1 comment:

  1. I just made a chrome extension that exports your chrome history as a csv Excel-readable spreadsheet and json: https://chrome.google.com/webstore/detail/hcohnnbbiggngobheobhdipbgmcbelhh/publish-accepted

    ReplyDelete