Featured Post

Elon Musk’s Influence on the 2024 Presidential Election and Its Potential Outcomes

  In the upcoming 2024 U.S. presidential election, the influence of tech moguls like Elon Musk is a point of significant interest. Musk, with his vast following, has demonstrated an ability to sway public opinion through his business decisions, public statements, and presence on social media platforms like X (formerly Twitter). The effect Musk’s actions may have on the election—and candidates such as Donald Trump—is worth examining as he becomes a key player in the larger landscape of digital influence. Elon Musk and Digital Influence in Politics A Shift in Public Influence Musk’s reach extends beyond business; he is now a major influencer in political spheres. By acquiring X, Musk gained direct access to one of the most influential social media platforms in the world, where he regularly engages with a diverse audience. His unpredictable political stances and commentary resonate with millions, and his platform decisions have the potential to shape public opinion. Musk’s Public Poli...

How to Search Emails in Gmail by Specific Time

 Gmail supports a plethora of search operators to help you instantly find that elusive email message buried in your mailbox. You have size search - like larger_than:5mb - to find the big messages in your account. File search - like has:attachment filename:doc - will locate email messages that contain specific file attachments. This graphic illustrates all the known Gmail search operators that work both on Gmail website and mobile.

Gmail Search Tricks

Search by Date in Gmail

Date search in Gmail helps you locate emails sent or received during a specific period. Here are some examples:

  • newer_than:7d from:me - Emails sent in the last 7 days
  • after:2020/10/15 before:2020/10/20 from:uber - Emails from Uber received between October 15 and October 20.
  • newer_than:60d older_than:30d - All emails received in the previous 30-day range.

The date in the Gmail search query is specified in the YYYY/MM/DD format.

Search Emails by Specific Time in Gmail

Gmail supports an undocumented time-based search option that lets you find emails sent or received during a specific hour, minute or event second. For instance, you can limit your Gmail search to emails that were received between October 10 8:15 PM and October 10, 2020 8:45 PM.

Gmail Search Date and Time

To get started, convert the date and time to Epoch time and then use the timestamp with the standard after or before search operator of Gmail.

For instance, the Epoch time for October 10 8:30 PM is 1602774000 and that of October 10 8:45 PM is 1602774900. Use the search query after:1602774000 before:1602774900 to:me in Gmail and you’ll get a list of all emails that were received during that 15-minute period.

Epoch time is the number of seconds that have elapsed since January 1, 1970 (UTC). Use the Epoch converter to represent a human readable date and time in Epoch and use that timestamp with the before or after search operator of Gmail to find that elusive email.

Date and Time Search with Google Script

Here’s a little snippet that will automate your Gmail search by time using the Gmail API. It will fetch all email messages that were received between 12:15 PM and 1:30 PM.

const emailReceived = () => {
  const secondsSinceEpoch = (date) => Math.floor(date.getTime() / 1000);
  const after = new Date();
  const before = new Date();
  after.setHours(12, 15, 0, 0);
  before.setHours(13, 30, 0, 0);
  const query = `after:${secondsSinceEpoch(after)} before:${secondsSinceEpoch(
    before
  )}`;
  const messages = Gmail.Users.Messages.list('me', {
    q: query,
  });
  Logger.log(messages);
};

Comments