Skip to content

Instantly share code, notes, and snippets.

@eevmanu
Created March 24, 2026 01:35
Show Gist options
  • Select an option

  • Save eevmanu/72adc27bfb7aade8144023ce5f7078a5 to your computer and use it in GitHub Desktop.

Select an option

Save eevmanu/72adc27bfb7aade8144023ce5f7078a5 to your computer and use it in GitHub Desktop.
gmail api docs to understand date search filter with timestamp
https://developers.google.com/workspace/gmail/api/guides/filtering
Caution: All dates used in the search query are interpreted as midnight
on that date in the PST timezone. To specify accurate dates for other
timezones pass the value in seconds instead:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list
date -d "today 00:00:00 $(date +%Z)" +"%s"
date -d "today 00:00:00 -5" +"%s"
date -d "tomorrow 00:00:00 $(date +%Z)" +"%s"
date -d "tomorrow 00:00:00 -5" +"%s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment