I want to restrict Google search to a specific date/time range. How can this be done?
1 Answer
I believe you are asking how to perform a Google search with a time value flag on the search.
This can be done by your program building its own search url. You likely already know that the searched string appears after the q=
flag in the url. For time based searches you add the tbs=qdr:
flag followed by the time period value you wish to use. Some of the possible values you can use are:
a
for any timen
for **- Add a number after n to tell Google how many minutes (i.e.
tbs=qdr:n15
for the last 15 minutes)
- Add a number after n to tell Google how many minutes (i.e.
h
for hour- Add a number after h to tell Google how many minutes (i.e.
tbs=qdr:h3
for the last 3 hours)
- Add a number after h to tell Google how many minutes (i.e.
d
for dayw
for weekm
for monthy
for year
Example: http://www.google.com/?gws_rd=ssl#q=querystring&tbs=qdr:d will search for querystring and return results that are dated in the last day.
You can also specify a date range using tbs=cdr:1,cd_min:xx/xx/xxxx,cd_max:xx/xx/xxxx
.