On TechRepublic: 10 ways users mess up their computers

Search:
Go!


See video that entertains and explains the latest in tech

Click Here
INSIDER SECRETS: Google hacks
Insider Secrets
More Insider Secrets 
Google hacks
 Tip 2: Search a particular date range
Submitted by:
Tara Calishain and Rael Dornfest
Coauthors, Google Hacks
Search a particular date range
Rate this tip
How useful was this tip for you?
 Very
 Somewhat
 Not at all
An undocumented but powerful feature of Google's search is the ability to search within a particular date range. Before delving into the actual use of date range searching, there are a few things you should know. First, a date range search has nothing to do with the creation date of the content and everything to do with the indexing date of the content. If I create a page on March 8, 1999, for instance, and Google doesn't get around to indexing it until May 22, 2002, for the purposes of a date range search, the date in question is May 22, 2002.

Second, Google can index pages several times, and each time it does so, the date on it changes. So don't count on a date range search staying consistent from day to day. The "daterange: timestamp" can change when a page is indexed more than once. Whether it does change depends on whether the content of the page has changed.

Third, Google doesn't stand behind the results of a search done using the date range syntaxes. So if you get a weird result, you can't complain. Google would rather you use the date range options on its Advanced Search page, but that page allows you to restrict your options only to the last three months, six months, or year.

The date range syntax
Why would you want to search by date range? There are several reasons:

  • It narrows down your search results to fresher content. Google might find some obscure, out-of-the-way page and index it only once. Two years later, this obscure, never-updated page is still turning up in your search results. Limiting your search to a more recent date range will result in only the most current matches.

  • It helps you dodge current events. Say John Doe sets a world record for eating hot dogs and immediately afterward rescues a baby from a burning building. Less than a week after that happens, Google's search results will be filled with John Doe. If you're searching for information on (another) John Doe, babies, or burning buildings, you'll scarcely be able to get rid of him.

    However, you can avoid Mr. Doe's exploits by setting the date range syntax to before the hot dog contest. This also works well for avoiding recent, heavily covered news events, such as a crime spree or a forest fire, and annual events of at least national importance such as national elections or the Olympics.

  • It allows you to compare results over a period of time; for example, if you want to search for occurrences of Mac OS X and Windows XP. Of course, a count such as this isn't foolproof; indexing dates change over time. But generally it works well enough that you can spot trends.

Using the date range syntax is as simple as typing daterange:startdate-enddate. The catch is that the date must be expressed as a Julian date (see below). So, for example, July 8, 2002, is Julian date 2452463.5 and May 22, 1968, is 2439998.5. Furthermore, Google isn't fond of decimals in its date range queries; use only integers: 2452463 or 2452464 (depending on whether you prefer to round up or down) in the previous example.

The date range syntax does wonders for narrowing your search results. Let's look at a couple of examples. Geri Halliwell left the Spice Girls around May 27, 1998. If you wanted to get a lot of information about the breakup, you could try doing a date search in a 10-day window--say, May 25 to June 4. That query would look like this:

"Geri Halliwell" "Spice Girls" daterange:2450958-2450968

At the time of this writing, you'll get about 16 results, including several news stories about the breakup. If you want to find less formal sources, search for Geri or Ginger Spice instead of Geri Halliwell. That example's a bit on the silly side, but you get the idea. Any event that you can clearly divide into before and after dates--a death, an overwhelming change in circumstances--can be reflected in a date range search.

You can also use an individual event's date to change the results of a larger search. For example, former ImClone CEO Sam Waksal was arrested on June 12, 2002. You don't have to search for the name Sam Waksal to get a very narrow set of results for June 13, 2002:

imclone daterange:2452439-2452439

Similarly, if you search for imclone before the date of 2452439, you'll get very different results. As an interesting exercise, try a search that reflects the arrest, but date it a few days before the actual arrest:

imclone investigated daterange:2452000-2452435

This is a good way to find information or analysis that predates the actual event, but that provides background that might help explain the event itself. (Unless you use the date range search, this kind of information is usually buried underneath news of the event itself.)

If you prefer to perform Google date range searches without all this nonsense about Julian date formats, use the FaganFinder Google interface, an alternative to the Google Advanced Search page, sporting date range searching via a Gregorian (read: familiar) date pull-down menu.

Understanding Julian dates
While date-based searching is fantastically useful, date-based searching with Julian dates is annoying at best--for a human, anyway. A Julian date is just one number. It's not broken up into month, day, and year. It's the number of days that have passed since January 1, 4713 B.C.

Unlike Gregorian days (those on the calendar you and I use every day), which begin at midnight, Julian days begin at noon, making them useful for astronomers. While problematic for humans, they're rather handy for computer programming, because to change dates you simply have to add and subtract from one number and not worry about month and year changes, not to mention leap years and the differing number of days in each month. Google's "daterange: special syntax" element employs Julian dates.

If things weren't confusing enough, there is actually another date format that is also known as a Julian date format, a five-digit number, yyddd, where the first two digits represent the most significant digits of the year and the last three represent the day of the year, where the value is between 1 and 365 (or 366 in a leap year). Google's date range syntax doesn't support the yyddd format.

There are plenty of places to convert Julian dates online. A couple of nice converters are at the U.S. Naval Observatory Astronomical Applications Department and Mauro Orlandini's home page, the latter converting either Julian to Gregorian or vice versa. More Julian dates and online computers can be found via a Google search for Julian date.


Submitted by:
Tara Calishain and Rael Dornfest
Coauthors, Google Hacks
Tara Calishain is the founder of ResearchBuzz, a repository of information about search engines. She is also coauthor of Google Hacks and Spidering Hacks. Rael Dornfest is chief technology officer at O'Reilly Media, series editor of the O'Reilly Hacks series, and author or coauthor of multiple O'Reilly books.

Google Hacks This material has been adapted from Google Hacks by Tara Calishain and Rael Dornfest, published by O'Reilly Media. Copyright O'Reilly Media, 2004. All rights reserved. O'Reilly makes no representation as to the accuracy of the materials provided by them. To purchase this or other O'Reilly publications, click here.
MORE INSIDER SECRETS
CNET shows you three easy ways to capture and save video from the Internet.
You can double or triple the amount of space on your laptop.
Check out our tips to making video work on your iPod, Creative Zen Vision, or Archos video player.
Use these tips to fine-tune your searches, personalize the Web, and pit Yahoo against Google.
Turn your tablet into the ultimate productivity tool with some free software and these tips.
Whether you're playing as a Good god or an Evil god, we have three tips that'll help you rack up the points.



Copyright ©2008 CNET Networks, Inc. All rights reserved. Privacy policy|Terms of use