-
-
Save eevmanu/72adc27bfb7aade8144023ce5f7078a5 to your computer and use it in GitHub Desktop.
| 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" |
how to create a search url to share with colleagues to find a specific mail on specific mail account?
assuming you have a google workspace account with domaing pepito.com so <username>@pepito.com
first constraint domain from google account as path parameter
https://mail.google.com/mail/a/pepito.com/#search/...
second constraint date
input (e.g.): May 08, 2026
calculate after and before timestmap to specific a particular date
(could granularize more but i'll leave it to the reader)
convert May 08, 2026 into rfc3336 format
-> 2026-05-08 or w/o minus signs 20260508
after that calculate the timestamps
TARGET_DATE="20260508"
LOCAL_TZ=$(date +%Z)
date -d "$TARGET_DATE 00:00:00 $LOCAL_TZ" +"%s"
date -d "$TARGET_DATE + 1 day 00:00:00 $LOCAL_TZ" +"%s"
output is
- after:1778216400
- before:1778302800
source: https://developers.google.com/workspace/gmail/api/guides/filtering
after that you could use any of the most commen search operators like (e.g.):
from:people_culture@pepito.com
source: https://support.google.com/mail/answer/7190
in this particular example the final url could looks like
https://mail.google.com/mail/a/pepito.com/#search/after%3A1778216400+before%3A1778302800+from%3Apeople_culture%40pepito.com
the pattern entered in the search bar is
after:1778216400 before:1778302800 from:people_culture@pepito.com
how to generate timestamps using my local timezone when a date (in rfc 3339 w/ or w/o middle hyphen-minus)
verify with
-> https://www.epochconverter.com/
or