Table of contents:

Undocumented Gmail Feature: How To Search For Emails To The Second
Undocumented Gmail Feature: How To Search For Emails To The Second
Anonim

It turns out that Gmail search operators do not limit searches to days and can sort emails with an accuracy of hours, minutes, and even seconds. The main thing is that the message should come no earlier than January 1, 1970.

Undocumented Gmail Feature: How To Search For Emails To The Second
Undocumented Gmail Feature: How To Search For Emails To The Second

Google engineers taught the Gmail search bar a few dozen commands to help you find any email. You can use:

  • Search by size. The larger: 5M command will list the largest messages.
  • Search by attachment type. The filename: doc command will display letters with attached Word documents.
  • Search for specific tags. The has: yellow-star command will filter out messages marked with a yellow star.

A complete list of search operators can be found at. It also indicates that the postal service is able to sort letters by time of receipt. For this, the following operators are highlighted:

  • Search in a given period of time. The after: 2016/12/18 before: 2016/12/20 command will narrow down the sample to three days.
  • Search with reference to the current time. Newer_than: 7d will limit the result to one week.

In the last example, instead of days (d), there can be months (m) or years (y). As you can see, there is no direct evidence that the filter works with greater accuracy. However, in practice, there is such a possibility, but for this you have to understand the UNIX time representation system.

UNIX Time in Gmail

In the early days of the computer boom, programmers were puzzled by the question of how to encode time in order to waste fewer bytes and not worry about the date format. We decided that a simple build-up of seconds would work best. The starting point was taken at midnight on the first Thursday of 1970. From that moment on, mankind entered the UNIX era and began to adhere to the new time reckoning.

UNIX time is the number of seconds that have passed since January 1, 1970. The Gmail filter understands UNIX time, so the search interval can be reduced to as little as one second.

In a real-life situation, such accuracy seems excessive, if only because Gmail does not indicate seconds in the date of receipt of the letter. Therefore, it is worth limiting yourself, for example, to ten-minute intervals.

unix time: search by date
unix time: search by date

How to convert time to UNIX format? We can assume that there are 86,400 seconds in a day, and then start multiplying. But it's better to look into a specialized web service. Everything is simple here: select the year, month, hours and minutes, then copy the UNIX time and use it with the after and before operators in Gmail.

unix time: Epoch Converter
unix time: Epoch Converter

Of course, the trick itself is by no means generally useful. However, curious Gmail users may find it interesting.

Recommended: