Someone gave me a task to find all e-mail messages sent or received in Gmail:
- in given period of day -- after 16:00 given day and before 08:00 the next day and
- in given period of week -- between 00:00 and 23:59 during weekends,
so, generally speaking, outside office hours.
Gmail has a quite powerful filtering mechanism, but it:
- uses timestamps (Unix Epoch) instead of actual dates and
- can't operate on multiple dates in the same time.
For some internal reasons I couldn't follow the "automatic way" suggestion (i.e. to upload messages from Gmail to Google Sheets and try to filter them there) and thus I decided into semi-automatic way.
Meaning that I wrote an Excel sheet which generated Gmail's filtering queries for me for all required dates and I only have to manually copy-paste them into Gmail's search box.
You can get similar results Epoch Converter's batch tool, but I wanted to play a little bit with Excel instead.