Imported bookmarks from Chrome do not retain original date added
Last time I imported bookmarks from Chrome, several months ago, all bookmarks retained their correct date added attribute.
Now, If I try importing bookmarks, all imported bookmarks lose their original dates, and have both "date added" and "date modified" as the time when I imported.
I tried this with all extensions and add-ons disabled, and it still happened.
I spent an hour trying to google keywords on this issue and came up empty. any help?
Όλες οι απαντήσεις (6)
OP here. Please, someone, This is really important for me. I need to be able to organize many of my bookmarks by the year i bookmarked them.
The following part of the post is to help hit keyword searches for anybody else googling this question, (in case someone posts a solution):
Firefox bookmarks import date added wrong. Firefox import bookmarks losing date added. When Importing bookmarks from chrome the date added is wrong or missing. Bookmarks lose metadata on import.
Did you compare the bookmarks.html file created by Google Chrome with one created by Firefox to make sure that they are compatible?
When Firefox imports bookmarks from Chrome, it imports directly from the Bookmarks file in the Chrome local app data folder, not an exported bookmarks html file. Bookmarks html files have significantly less detailed information.
Last time I did this, I discovered 2 things. First, that If I export all my chrome bookmarks to an html file and then import that to Firefox, it doesn't keep the date. And Second, that if I import directly from the browser, all the bookmarks keep their original date added, when they were added in Chrome.
The exported bookmark.html files are not compatible, and to my knowledge, never have been, because Chrome uses a different date format. More details here. But this is irrelevant, because, again, Firefox doesn't import from the html file produced by Chrome, it imports it directly from the bookmarks file in the App data folder.
This screenshot http://i.imgur.com/1xvUUhJ.png shows one time I imported bookmarks from Chrome. The "last modified" is the date they were imported. "Added" is when I originally added them in Chrome. This is the normal behavior, because Firefox converts the time format from Chrome's source bookmark file into it's own format, when it imports from Chrome (but doesn't when it imports from from Chrome exported bookmarks.html files).
Or at least, it's supposed to. This screenshot http://i.imgur.com/UT1NLMb.png shows what it looks like when I tried it recently (I tried it yesterday too, but deleted all of them because there are so many. didn't wanna do it again just for the screenshot.)
leostaley said
The exported bookmark.html files are not compatible, and to my knowledge, never have been, because Chrome uses a different date format. More details here. But this is irrelevant, because, again, Firefox doesn't import from the html file produced by Chrome, it imports it directly from the bookmarks file in the App data folder.
In order to import from an exported HTML file, you need to use a different menu command in the Library dialog. See: Import Bookmarks from an HTML file.
I haven't seen an old Chrome bookmarks export file, but I bookmarked pages in Chrome and Firefox this evening, exported from both, and compared the HTML source:
Chrome 6:27 PM: ADD_DATE="1483756069" Firefox 6:28 PM: ADD_DATE="1483756093"
They seem to be using the identical date format in their current versions. Added dates were preserved during import. Note that this was a very small import of about a dozen bookmarks because I only use Chrome for occasional comparison.
leostaley said
Bookmarks html files have significantly less detailed information.
I'm obviously not a power user of bookmarks. What data is missing?
This screenshot http://i.imgur.com/1xvUUhJ.png shows one time I imported bookmarks from Chrome. The "last modified" is the date they were imported. "Added" is when I originally added them in Chrome. This is the normal behavior, because Firefox converts the time format from Chrome's source bookmark file into it's own format, when it imports from Chrome (but doesn't when it imports from from Chrome exported bookmarks.html files).
Or at least, it's supposed to. This screenshot http://i.imgur.com/UT1NLMb.png shows what it looks like when I tried it recently (I tried it yesterday too, but deleted all of them because there are so many. didn't wanna do it again just for the screenshot.)
Yes, when I use Import Data from Another Browser and select Chrome and Bookmarks, the Added dates are incorrect for me, too.
Firefox use microsecond resolution to store the date-time in the places.sqlite file, but uses microsecond format for the bookmarks.html file for historical reasons as this is a change that is more recent.
You would have to parse the Google Chrome bookmarks.html file and divide all 16 digit time stamps by 1000 or remove the last three digits to make Firefox use these dates.
Suitable JavaScript for the Web Console or a bookmarklet (z sets the length in digits).
javascript:(function(){var z=13,e=document.querySelectorAll("*[add_date],*[last_modified]"),atr=["add_date","last_modified"],i,j,k=0;for(i=0;E=e[i];i++){for(j in atr){if(a=E.getAttribute(atr[j])){if(z>a.toString().length){while((a=E.getAttribute(atr[j])).toString().length<z){E.setAttribute(atr[j],a+"0")}}else{E.setAttribute(atr[j],a.substr(0,z))}}}k++}console.log(k)})()